Robocopy is a great command line copy tool from Microsoft which goes far beyond copy and xcopy. Think of it as “Synctoy for scripts”. It is a part of Vista and Win2k8 or can be downloaded for free from Microsoft as part of the Windows Server 2003 Resource Kit Tools.
The features are interesting!
- Ability to tolerate network outages and resume copying where it previously left off
- Ability to correctly copy attributes, owner information, alternate data streams etc.
- Ability to correctly copy NTFS ACLs
- A “mirror” mode, which keeps trees in sync by optionally deleting files out of the destination that are no longer present in the source.
- Ability to copy large numbers of files that would otherwise crash the built-in XCOPY utility.
- Resident mode (robocopy stays in memory and monitors the source folder for changes and copies them as they happen)
Usage is straightforward:
robocopy C:\myfiles \\backup\myfiles /MIR /Z
mirrors the folder “c:\myfiles” (including subfolders) to the \\backup server, destroying any files in the target folder(s) that are not present in myfiles (/MIR). It copies files in restartable mode (/Z) in case network connection is lost.
Because the list of command line options is enormous it is a good idea to use one of the free GUI programs.