Gshultz DR Robocopy 10-29
Gshultz DR Robocopy 10-29
By Greg Shultz
Soon after Windows Vista came out, I discovered that Microsoft had updated the venerable Robocopy with a bunch of extra features and made it a regular part of the Windows operating system. Of course, when Windows 7 came out I immediately examined the newest version of Robocopy and discovered that Microsoft had again updated Robocopy with a single, but very powerful new feature - the ability to perform a multi-threaded copy option. More specifically, with multi-threaded capabilities Robocopy can now simultaneously copy multiple files in parallel, which will result in very fast backup operations. In this edition of the Windows Desktop Report, I'll show you how to take advantage of Robocopy's features to create an exact mirrored duplicate of all the pertinent data files in your user profile folder (C:\Users\YourName). As I do, I'll show you how to use the new multi-threaded copy feature.
Page 1
Copyright 2010 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/
Robocopy "C:\Users\Greg Shultz" "G:\TheBackup" /MIR /XA:SH /XD AppData /XJD One of Robocopy's most useful features comes into play when it encounters a file that is in use. When it does, Robocopy will stop and wait for that file to be closed so that it can continue with the copy operation. It will retry to copy the file every 30 seconds. The default number of retries is 1 million (no joke!). As this will most like prevent the backup operation from ever completing, you should reset it to a reasonable number. To change the number of retries, you'll use the /R switch and to change the wait time between retries you'll use the /W switch. I chose 5 retries with a 15 second wait time. That way after a reasonable number of retries and wait period, Robocopy will move on. As such, my command is now: Robocopy "C:\Users\Greg Shultz" "G:\TheBackup" /MIR /XA:SH /XD AppData /XJD /R:5 /W:15 At this point, I am ready to add the new multi-threaded switch: /MT[:n], where n is a number from 1 to 128 and indicates the number of threads to be used. Keep in mind that n is optional and that by default, the /MT switch will use 8 threads. I'll use 32 threads in my example, as I found it to be a good starting point. (Note that the multithreaded option is not compatible with the /IPG and /EFSRAW switches.) At this point, my command is now: Robocopy "C:\Users\Greg Shultz" "G:\TheBackup" /MIR /XA:SH /XD AppData /XJD /R:5 /W:15 /MT:32 Like all command line tools, Robocopy keeps you apprised of the status of operation right in the Command Prompt window. However, chances are that you'll want to customize and record that feedback in a log file. I like to have the whole picture, so I'll use the /V switch. However, I really don't need to know the percentage progress of each file copy, so I'll use the /NP switch. To create my log file, I'll use the /LOG switch, which will overwrite the existing log file each time. Now, my command is: Robocopy "C:\Users\Greg Shultz" "G:\TheBackup" /MIR /XA:SH /XD AppData /XJD /R:5 /W:15 /MT:32 /V /NP /LOG:Backup.log
Page 2
Copyright 2010 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/
Additional resources
TechRepublic's Downloads RSS Feed Sign up for TechRepublic's Downloads Weekly Update newsletter Check out all of TechRepublic's free newsletters
Version history
Version: 1.0 Published: October 26, 2010
Page 3
Copyright 2010 CBS Interactive. All rights reserved. For more downloads and a free TechRepublic membership, please visit http://techrepublic.com.com/