The easiest way to back up files in Windows is probably just to copy and paste them to another drive. There is one issue with this, however. Maintaining a backup of a small amount of data is easy, but keeping up with a backup of hundreds of gigabytes of files can become tedious. This is especially true if Windows runs in to a file that already exists on your backup drive.
If that happens at the beginning of your backup, you can just check a box and make it skip the files that already exist. If that doesn’t happen at the very beginning of a large backup,you might have to wait for hours before Windows runs in to a file that exists already. Most people probably would not want to baby-sit their backups until they finish. That’s where Robocopy comes in! (Yes, my example situation is actually something that has happened to me a couple of times.)
Robocopy (a.k.a. Robust File Copy) is a command-line tool that is included with most versions of Windows. It’s actually very handy for scenarios like the one mentioned above. You can use it by typing robocopy <source drive letter>:\ <destination drive letter>:\
in Command Prompt. To copy from drive D to drive E, you would type robocopy D:\ E:\ in Command Prompt
. True to it’s name, Robocopy is very robust and is capable of more than just blindly copying files from the source to the destination.
The /XD
argument can be used to exclude certain folders (listed in quotes immediately after) from the destination drive. For example, robocopy D:\ E:\ /XD "skip-me"
would exclude the folder called “skip-me” from the backup.
The /XO
argument can be used to ignore files on the source drive if they are older than the copies on the backup drive. robocopy D:\ E:\ /XO
can be helpful if you happened to modify a file on the backup drive.
The /A-:SH
argument tells Robocopy to ignore those messy system files that Windows likes to put on drives. robocopy D:\ E:\ /A:-SH
would keep that stuff out of your destination drive.
The /MIR argument can be used to mirror the directory structure of the source drive. Without it, Robocopy only copies files directly inside the directory you choose. It ignores all directories within your source directory. It also deletes files from the destination drive if they do not exist in the source drive. Example use: robocopy D:\ E:\ /MIR
This is an important feature for me, since I am in the process of deleting files I don’t need any more. These files automatically get deleted from my backup drive, which saves me a little time.
The /E
argument can be used instead of /MIR
, if the warning I gave earlier made you feel queasy. Using robocopy D:\ E:\ /E
will copy your directory structure without the chance of deleting anything. If you don’t plan on deleting anything, it is just as useful as /MIR
.
Now we know some good arguments for Robocopy. Here’s a personal example of how I use it for making my own backups. robocopy D:\ E:\D_backup\ /MIR /XO /XD "$RECYCLE.BIN" "System Volume Information" /A-:SH
This copies the files directories from my source (D:\
) to the destination (E:\D_backup\
) while excluding older files, system files, the “$RECYCLE.BIN”
folder, and the “System Volume Information”
folder. It also deletes files that no longer exist in the source.
This isn’t the best solution for every scenario, but it works nicely in my case!