Backing up your computer with Robocopy

Windows 7 has a great tool called “Windows Backup.” It’s great because it creates a system image, then zips up and copies all files specified to another hard disk or network drive. But what makes this kinda useless is the fact that every time you run the backup, it’ll copy everything over to the hard disk or network location.

So while it may be great for the system image, it’s not the sort of thing I like to do for everything else.  For starters, my computer has about 600Gb of stuff on it, and I don’t want to be copying it all over to my server every night.

That’s where Robocopy comes in.

I have a file called backup.bat which looks like this:

@echo off
robocopy c:\users\leigh\desktop y:\desktop /E
robocopy c:\users\leigh\documents y:\documents /E /XJ
robocopy g:\ y:\games /E
robocopy s:\ y:\storage /E

So what does all that mean? The 2 lines copy  my user files over to a shared directory on my server which is mapped as Y:. Third line copies my Games disk over. Fourth line copies my Storage disk, where I keep anything else.

The /E switch on the end forces robocopy to copy everything recursively. The /XJ switch gets around a little issue with your documents folder, where there are Junctions to your music, pictures etc. folders. These junctions cannot be accessed by robocopy, so /XJ (eXclude Junctions) will skip them for you.

Robocopy is smart enough to only copy stuff which is new, or has been modified since the last time you copied. Everything else will be skipped.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s