Using EMCopy to sync drives/directories
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 1 2 3.
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.
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.
Update 9 Oct 2021
The EMC site no longer works, everything has been moved behind Dell's support portal. While I found links and Knowlege Base articles indicating this should be in the support tools section, a search for "EMCOPY" comes up with nothing.
The latest version that I'm aware of is 4.17 and has the following sha256 hashes:
emcopy.exe - ACAF5058C91C2E71D582ED2DF98EF8E4DBCBAF4D3116051404E713CAAC022C90
emcopy64.exe - 29CE81CEA678A4EC09EBE914411A08DCA3917343F45557D026046049C2BABCF5
If you know where to download a current/new version, or even an offical link to 4.17, please comment below.
Flags and options
I placed EMCopy on the server I wanted to move files to, and used the following...
emcopy.exe \\remoteserver.domain.com\F$ F:\ /o /secforce /s /de /sd /c /r:1 /th 16 /cm md5 /purge /sdd
I'll break that down in logical blocks, not necessarily how it's listed above:
\\remoteserver.domain.com\F$ 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.
/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.
/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.