Author |
Message |
Registered: March 18, 2007 | Posts: 150 |
| Posted: | | | | Would love to have the ability to construct my own filename based upon "system variables"
For instance I always back up my database to [BACKUP PATH]\DVDProfilerBackup.[YY]-[MM]-DD]
Anyone else think this would be useful?
Ritch | | | Learning is not mandatory, but then neither is survival. |
|
Registered: January 1, 2009 | Reputation: | Posts: 3,087 |
| Posted: | | | | +1 Not bad. Til now I change the name of the backup file every day manual. |
|
Registered: July 31, 2008 | Reputation: | Posts: 2,506 |
| Posted: | | | | Indeed, it sounds like a good idea. |
|
Registered: March 19, 2007 | Posts: 259 |
| Posted: | | | | +1 | | | Markku |
|
Registered: May 19, 2007 | Reputation: | Posts: 5,917 |
| |
Registered: May 19, 2007 | Reputation: | Posts: 6,730 |
| Posted: | | | | | | | It all seems so stupid, it makes me want to give up! But why should I give up, when it all seems so stupid?
Registrant since 05/22/2003 |
|
Registered: March 14, 2007 | Reputation: | Posts: 4,667 |
| |
Registered: March 13, 2007 | Posts: 404 |
| Posted: | | | | You can sort of do this now by creating a .bat file.
@echo off echo BackupAll "[Backup Path]\Backup%random%.dpb" RenameExisting > "[Backup Path]\Command.txt" "C:\Program Files\DVD Profiler\dvdpro.exe" /CommandFile="[Backup Path]\Command.txt"
Create a text file into this directory called dvdpro.bat and paste in the above 3 lines of code. Call it something like DVDProBackup.bat Then run the batch file. This will run dvdpro and create a backup file called Backup#####.dpb where ##### is just some random number. You can sort the directory by date and you will have a listing of all your backups in date order.
It's not completely perfect, I would have liked to use date instead of a random number but then it tried to create a file with /, which isn't allowed. Didn't want to spend the time trying to figure out how to remove them in the script. | | | The Other DVD Forum Why do people who know the least know it the loudest? |
|
Registered: May 22, 2007 | Reputation: | Posts: 1,033 |
| Posted: | | | | If you want to use Cool_doodad's batch solution but still want the date you can use this batch code to get the date (in YYYY-MM-DD format, I use that because if you sort by name it keeps files in order across years and month) Quote:
@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @( Set Day=%%A Set Month=%%B Set Year=%%C )
SET mydate=%Year: =%-%Month: =%-%Day: =%
just put that chunk of code on the line after @echo off and replace %random% with %mydate% -Agrare |
|
Registered: May 11, 2007 | Posts: 249 |
| |
Registered: May 22, 2007 | Reputation: | Posts: 1,033 |
| Posted: | | | | Oh, forgot to add. The @For line may need to be adjusted depending on your locality. The way it is currently written will work for US. It shouldn't be too hard to convert to other localities though. The site I found that part from someone actually posted the line for German locality
@For /F "tokens=1,2,3 delims=. " %%A in ('Date /t') do @(
-Agrare |
|
Registered: March 13, 2007 | Posts: 404 |
| Posted: | | | | Quoting Agrare: Quote: If you want to use Cool_doodad's batch solution but still want the date you can use this batch code to get the date (in YYYY-MM-DD format, I use that because if you sort by name it keeps files in order across years and month)
Quote:
@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @( Set Day=%%A Set Month=%%B Set Year=%%C )
SET mydate=%Year: =%-%Month: =%-%Day: =%
just put that chunk of code on the line after @echo off and replace %random% with %mydate%
-Agrare Nice...It's been years since I've messed with batch files. Green arrow for you. | | | The Other DVD Forum Why do people who know the least know it the loudest? |
|
Registered: March 13, 2007 | Reputation: | Posts: 2,217 |
| Posted: | | | | Awesome Batch-Magic! Quoting Agrare: Quote: The @For line may need to be adjusted depending on your locality. [...] It shouldn't be too hard to convert to other localities though. Jupp, just type "date /t" in a command-line and look what your date looks like. Worked perfect for me when I tried to add hours and minutes with "time /t". @echo off SET BackupPath=C:\Users\Mithi\Documents\DVD-Profiler-DB @For /F "tokens=1,2,3 delims=. " %%A in ('Date /t') do @( Set Day=%%A Set Month=%%B Set Year=%%C ) SET mydate=%Year: =%-%Month: =%-%Day: =% @For /F "tokens=1,2 delims=: " %%A in ('Time /t') do @( Set Hour=%%A Set Minute=%%B ) SET mytime=%Hour: =%%Minute: =% SET mydatetime=%mydate%-%mytime% echo BackupAll "%BackupPath%\Backup-v3.6-%mydatetime%.dpb" NoCoverScans NoCastCrewDB RenameExisting > "%BackupPath%\Command.txt" echo Close >> "%BackupPath%\Command.txt" "C:\Program Files\DVD Profiler\dvdpro.exe" /CommandFile=%BackupPath%\Command.txtcya, Mithi | | | Mithi's little XSLT tinkering - the power of XML --- DVD-Profiler Mini-Wiki |
|