Robocopy, or 'Robust File Copy', is a command-line directory and/or file replication command.Robocopy functionally replaces Xcopy, with more options. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was first introduced as a standard feature in Windows Vista and Windows Server 2008.
Recently I was tasked with syncing some shared drives so we could upgrade a server. I started down the path of finding the best tool for the job, Googling Robocopy, XCopy, RichCopy, etc. My requirements were that the tool had to copy security permissions for the shared folders, had to be able to copy across the network, and needed to be able to sync just deltas so we didn't have to copy hundreds of GB's every time something changed. I came across a few recomendations for EMCopy 123.
Emcopy Switches
- Emcopy switches (Direct hit found) Encopy. Software Utilities. Recovers files from damaged media such as scratched disks. Wildcard support. Fixes allocation errors. Optic disc.
- What I have found on a long quest of trial and error is a utility called 'EMCopy' from EMC. It is a free data migration tool, CLI only, and has a lot of features that just seem to work better than RoboCopy. I'll just give you a few quick points of what works better with EMCopy. Multithreading: EMCopy supports up to 256 threads.
Other people have done more in depth comparisons of the various tools. This is just my recommendation and an example of how it's being used in my environment.
Download
First, the download. I couldn't find where on EMC's site they had the newest version, but searching the support forums I came across a direct link. Register for an account, log in, and follow the direct link.
Flags and options
I placed EMCopy on the server I wanted to move files to, and used the following...
I'll break that down in logical blocks, not necessarily how it's listed above:
remoteserver.domain.comF$ F:
- Source path followed by destination path. In this case I'm coping entire drives (F: drive) from a remote server to the local server
/s /purge /sdd
- Directory options. /s copies sub directories. /purge removes files and directories from the destination that do no exist in the source. /sdd forces the target directories dates to be synchronized with the source directory.
/de
- Compares both file size and last modification time when deciding to update a file, updates it if either have been changed.
Emcopy Commands
/cm md5
- checks the file content after copying using and md5 comparison of the source and destination.
/o /secforce /sd
- /o copies the files owner, without this the account used for the copy will be the owner. /secforce overwrites the destination security settings with the source security settings (copies security settings). /sd preserves security, the file isn't copied if an error occurs during security settings.
/th 16
- Uses 16 threads, default is 64.
Emcopy Vs Robocopy
/r:1 /w:30 /c
- /r:1 retires one time (default I believe is 100), I don't care to have it retrying all day because someone left a word document opened. If it fails it fails and I'll catch it tomorrow. /w:30 is the wait time in seconds between retries. /c will allow the process to continue after the retries.