Windows Robocopy

Post date: Sep 09, 2011 12:2:10 AM

...is a Windows CLI tool that is awesome for backup and replication purposes.  It lets you copy entire folder structures with their time stamps and security permissions intact - something no other native Windows command does.  More than that, it can verify the source against the target and only copy the delta, i.e. the new and changed files - great if you only need to update a previous backup rather than do a whole new one.

There are several resources dedicated to robocopy:

Being CLI (Command Line Interface), the tool has a lot of flags or parameters to specify exactly what you want to do.  The format that worked for my purposes was: 

robocopy [source folder] [target folder] /e /sec /dcopy:T /r:3 /w:1 /log+:[log file] /np

The flags stand for:

Example:

You would like to copy the entire contents of your Android phone folder structure (mounted as a drive letter "P:") to a backup folder "N:\backup\Android", and append the log of the command to "N:\backup\Android.log" file without overwriting it:

robocopy P: N:\backup\Android /e /sec /dcopy:T /r:3 /w:1 /log+:N:\backup\Android.log /np

Note that robocopy is not exactly backup.  For example, an incremental backup process provides for storing multiple versions of the same file that is current as of the date of the backup.  Robocopy does not have a mechanism for that.  However if the purpose is to quickly and efficiently mirror folder structures across volumes - it is a very efficient and practical tool.

(Thank you Dan Henrickson and Arlys Alford for tipping me to this awesome tool.)