I have been using Windows Server Backup on a Windows 2008 R2 server for quite a while now to create nightly bare metal backups to a network drive in case of drive failure. The nightly backup overwrites itself each night.
Unfortunately bad sectors began appearing on my system drive. This allowed the nightly backup to be created WITH bad sectors and thus destroying any possibility of restoration. It also overwrote the previous backup, thus making the whole backup process worthless!
Am I using WSB as it was intended to be used? How do I circumvent the potential for overwriting backups with a faulty one that cannot be restored?????
Is it possible to make a batch script that validates the integrity of a backup and then offloads it if true? What would such a script look like?
I wrote a batch file that starts at 4am, which is guaranteed to be after all my backups are finished.
It RARs all the folders inside
WindowsImageBackup
(or whatever that folder is called), gives them a date stamped filename, and copies them to a secondary server, and from there they are replicated off-site.This way I've got months (years?) worth of historical backups, at least one of which will be good.
As for not overwriting backups, the only way WSB allows you to do this is to use a locally mounted block-storage device (such as a hard drive, USB drive or an iSCSI disk).
As for validating the image, I have another script that runs Sunday evening at the remote site that grabs a random backup image from the last 7 days, un-RAR's it, creates a VM and boots it. Because I haven't quite finished the scripting part, every Monday morning (when I remember) I spend 5 minutes just initiating the restore procedure and then check it later to see if it succeeded.
All in all it sounds a bit ghetto, but this particular client had a very limited budget (read: none), so I was restricted to using free tools. And so far it's worked really well.
To enable WBS at GPO level, and schedule a complete backup every night
To RAR files into date-stamped and passworded files (run on the server that hosts all the backup file shares)
Move files into off-site sync dir, and clean up the sync dir
prepareoffsite.bat
copyoffsite.bat
A little bit of an explanation:The batch takes the backup name and it goes through a list of txt files, and in each txt file it has a list of all the names of the machines. Depending on which file the machine name is in, it goes into a different folder (as some are synced nightly, others weekly, depending on how important they are).