Roelof,

On 23/01/06, Roelof Otten <[EMAIL PROTECTED]> wrote:
>   Via TB's scheduler I'm creating a new backup every week.
>   However, this backup overwrites the old backup as it has the same
>   name.
>   Does anybody know how to give them proper alternating names?
>   Something like the date as in YYYYMMDD.

Don't use TB's scheduler?
Ok, seriously: use it but if you can use an external batch file you
might be able to make use of builting date/time variables in it.
Example is attached.

Regards, Roman


PS: you have to play around with the "set ds=%%k%%j%%i" statement - it
will produce different reults depeding on your OS's language.

---------------------------------------------------------------------------
:: backup script for windows registry keys and some files
:: with date and time in backup filename

::Build a DTS variable
:: Using for/do, pull apart the output of date/t
set parsearg="eol=; tokens=1,2,3* delims=., "
for /F %parsearg% %%i in ('date/t') do set ds=%%k%%j%%i

:: Use the output of the above for/do in the next for/do
:: Using for/do, pull apart the output of time/t
set parsearg="eol=; tokens=1,2* delims=:, "
for /F %parsearg% %%i in ('time/t') do set dts=%ds%-%%i%%j


:: set program paths and folder locations
set winzipcall=C:\Programme\Utils\WinZip\wzzip
set regeditcall=C:\Windows\regedit
set xcopycall=C:\Windows\system32\xcopy
set tempdir=C:\Dokumente und Einstellungen\Roman\Lokale Einstellungen\Temp\
set backupdir=R:\backups\

%winzipcall% -a -en -r -P %backupdir%diplomarb_%dts%.zip
@"D:\E\Projects\backup_list.txt"

%xcopycall% "D:\Miranda\roman.dat" "%tempdir%" /y
%winzipcall% -a -en "%backupdir%miranda_%dts%.zip" "%tempdir%roman.dat"

%regeditcall% /e "%tempdir%thebat.reg" "HKEY_CURRENT_USER\Software\RIT"
%regeditcall% /e "%tempdir%putty.reg" "HKEY_CURRENT_USER\Software\SimonTatham"
%regeditcall% /e "%tempdir%winrar.reg" "HKEY_CURRENT_USER\Software\WinRAR"
%regeditcall% /e "%tempdir%winzip.reg"
"HKEY_CURRENT_USER\Software\Nico Mak Computing"

%regeditcall% /e "%tempdir%ultraedit1.reg"
"HKEY_CURRENT_USER\Software\IDM Computer Solutions"
%regeditcall% /e "%tempdir%ultraedit2.reg" "HKEY_CURRENT_USER\Software\IDM Comp"
%regeditcall% /e "%tempdir%ultraedit3.reg"
"HKEY_LOCAL_MACHINE\SOFTWARE\IDM Comp"

%regeditcall% /e "%tempdir%acdsee1.reg" "HKEY_CURRENT_USER\Software\ACD Systems"
%regeditcall% /e "%tempdir%acdsee2.reg"
"HKEY_LOCAL_MACHINE\SOFTWARE\ACD Systems"

%regeditcall% /e "%tempdir%texnic1.reg" "HKEY_CURRENT_USER\Software\ToolsCenter"
%regeditcall% /e "%tempdir%texnic2.reg"
"HKEY_LOCAL_MACHINE\SOFTWARE\ToolsCenter"
%regeditcall% /e "%tempdir%miktex1.reg" "HKEY_CURRENT_USER\Software\MiK"
%regeditcall% /e "%tempdir%miktex2.reg" "HKEY_LOCAL_MACHINE\SOFTWARE\MiK"

%regeditcall% /e "%tempdir%pc-bib.reg"
"HKEY_CURRENT_USER\Software\Expert System"
%regeditcall% /e "%tempdir%passwordsafe.reg"
"HKEY_CURRENT_USER\Software\Counterpane Systems"
%regeditcall% /e "%tempdir%cooledit.reg"
"HKEY_CURRENT_USER\Software\Syntrillium"

%regeditcall% /e "%tempdir%desktop_settings.reg"
"HKEY_CURRENT_USER\Control Panel\Desktop"

%winzipcall% -a -en "%backupdir%reg_%dts%.zip" "%tempdir%*.reg"

del "%tempdir%*.reg"



--

________________________________________________
Current version is 3.65.03 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to