Iain's IT Solutions Ltd.

Iain's IT Solutions Ltd Mobile Nav Menu

Data Backup

08-Nov-2012

I've finally got round to automating my data backup process. It's not been running for long so may get refined, but it's a lightweight solution using a batch file and the ROBOCOPY command with the /mir switch.

I simply list the source and destination folders and run it.

It seems to be very clever. The first time I run, it copies everything to the backup drive - including sub-folders. Subsequent times it only copies and overwrite files which have been modified. Any new files added are also picked up and copied and what's really nice is that any files deleted are also deleted from the backup. So it really does mirror.

As only new and modified files are copied across, subsequent runs are relatively quick.

I couldn't get the mirroring of deleted files to work with XCOPY. Also, it was just skipping a top level directory for some reason. I didn't solve this - I used ROBOCOPY instead.

I think ROBOCOPY is only available on Vista and above - so possibly not on XP. I'm using Windows 7.

I just need to think now of the best way and time of running the batch file...


Iain Clark 09-Nov-2012
To run the backup I set up a Logoff script in the Local Group Policy Editor. I had Windows 7 Ultimate - but I don't think this feature is available on the home edition. - Run "gpedit.msc" - Local Computer Policy - User Configuration - Windows Settings - Scripts - Logoff - Add and pick the batch file I tried adding the script in Shutdown of Computer Configuration - but it didn't work. I think because it shuts down before the script has time to run.



No links allowed (to stop persistent spamming...)




Optional - enter if you want to be alerted when new comments are added