Windows incremental backup script

backupscheduled-taskwindows

I'm from a linux background, and need to run an incremental backup script on windows. I already have a batch script which dumps my database into a file. What I'd like is to only keep backups for the last seven days in addition to one backup file per week for the last 4 weeks (for example). I presume it's possible to do something like this with the windows task scheduler and a clever batch script?

Thanks.

Best Answer

(loudhailer voice) STEP AWAY FROM THE BATCH SCRIPT

People from a Linux/Unix background frequently make the mistake of trying to do things on Windows in the Linux/Unix way, and the end result is invariably horrifying (the opposite is also true, of course).

Use NTBackup to set up the jobs you want, it will handle them properly and will create scheduled tasks for you. It does accept command-line params, but you are better off using the GUI, in particular as this is an unfamiliar environment for you. Ask yourself - is your data worth so little to you that you would run the risk of scripting something in an unfamiliar environment?

Be aware though that if the type of database can only be backed up using a file-based backup, there is no value in incrementals (or differentials, which would be preferred, as you only need the last full and the last diff to restore), as the entire file will be backed up every time.

Related Topic