This motivated me to figure out Windows backups. I am not sure that this is the greatest backup script, but it works for me. Here is what it does:
* creates a full backup every week (on monday)
* creates differential backups (with changes from the full backup) every day
* cycles N different backups so you have several weeks/days of backup
* copies the files from one backup media to another, MASTER to SECOND
* just requires one scheduled job
* uses a single selection of files for all backups
To set this up:
* create MASTER and SECOND directories and set the paths in the script
* use NTBackup.exe to create the file "backupList.bks" which lists what files to back up
* put the script into the MASTER directory
* schedule a job to run it every day
This script is provided as is, with no guarantee that it will work for you. Let me know if you have improvements.
REM set test=echo to test the script
rem echo Backup# %x%
IF "%DATE:~0,3%" == "Mon" GOTO WEEKLY
ECHO Running Daily backup
for /F %%m in (%MASTER%\dailyNumber.txt) do set /a x="%%m"
set /a x="( %x% + 1) %% (%keepDaily%)"
echo %x% > %MASTER%\dailyNumber.txt
ECHO Running Weekly backup
for /F %%m in (%MASTER%\weeklyNumber.txt) do set /a x="%%m"
set /a x="( %x% + 1) %% (%keepWeekly%)"
echo %x% > %MASTER%\weeklyNumber.txt
%test% ntbackup.exe backup "@%MASTER%\backupList.bks" ^
/n "%file%" /d "%DATE%" ^
/v:no /r:no /rs:no /hc:off ^
/m %type% /j "%file%" /l:s /f ^
%test% copy /Y /B "%MASTER%\%file%.bkf" ^
set local=%USERPROFILE%\Local Settings
set data=%local%\Application Data\Microsoft
move "%data%\Windows NT\NTBackup\data"\*.log ^