Robocopy Explained

Robocopy
Developer:Microsoft
Operating System:Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008
Latest Release Version:6.1
License:Proprietary

Robocopy, or "Robust File Copy", is a command-line directory replication command. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was introduced as a standard feature of Windows Vista, Windows 7 and Windows Server 2008. The command is robocopy.

Features

Robocopy is notable for capabilities above and beyond the built-in Windows copy and xcopy commands, including the following:

Notably, Robocopy will fail to copy open files. The so-called Backup mode is sometimes mistaken as an ability to copy open files, which it is not. Backup mode is an administrative privilege that allows Robocopy to override permissions settings (specifically, NTFS ACLs) for the purpose of making backups. The Windows Volume Shadow Copy service is the only Windows subsystem that can copy open files, which it does by snapshotting them for point-in-time consistency. Robocopy does not use the Volume Shadow Copy service in any way, limiting its usefulness as a stand-alone backup utility for volumes that may be in use. However, one can use a separate utility, such as VSHADOW or DISKSHADOW (included with Windows Server 2008), to create a shadow copy of a given volume, which Robocopy can then be directed to back up.

On the other hand, by design, the original Robocopy version is not able to replicate security attributes of files which have had their security permissions changed after an initial mirroring.[4] This behavior was changed on Robocopy versions included in Windows 2008 and Windows Vista. The downside of this is that Robocopy does not behave consistently between platforms.[5]

Robocopy cannot exclude files matching a wildcard including a directory e.g. /XF pictures\*.jpg generates an error.

Robocopy also cannot support excluding folders from the root only. e.g. /XD Music excludes both \Music and \Users\Name\Music and /XD \Music excludes nothing.

Common usage scenarios

Robocopy C:\A C:\B /E

Robocopy C:\A C:\B /COPYALL /E /R:0 /DCOPY:T

Robocopy C:\A \\backupserver\B /MIR /Z

For the full reference, see the Microsoft TechNet Robocopy page

It should be noted that using the /Z switch results in marked slowdown of copy operations.Please see the community content section of the TechNet reference

Folder copier, not file copier

Robocopy syntax is markedly different from standard copy commands, as it accepts only folder names as its source and destination arguments. File names and wild-card characters (such as "

") are not valid source or destination arguments. Files may be selected or excluded using the optional filespec filtering argument. Filespecs can only refer to the filenames relative to the folders already selected for copying. Fully qualified path names are not supported.

For example, in order to copy the file foo.txt from directory c:\bar to c:\baz, one could use the following syntax: Robocopy c:\bar c:\baz foo.txt

Bandwidth throttling

Robocopy's "inter-packet gap" (IPG) option allows some control over the network bandwidth utilized in a session. In theory, the following formula expresses the delay (D, in milliseconds) required to simulate a desired bandwidth (BD, in kilobits per second), over a network link with an available bandwidth of BA kbps:

D={BA-BD\overBA x BD} x 512 x 1000

In practice however, some experimentation is usually required to find a suitable delay, due to factors such as the nature and volume of other traffic on the network. The methodology employed by the IPG option may not offer the same level of control provided by some other bandwidth throttling technologies, such as BITS (which is utilized by Windows Update and BranchCache).

GUI front-end

Although Robocopy itself is a command-line tool, Microsoft Technet has provided a GUI front-end. The GUI requires the installation of the .NET Framework 2.0 (40 MB), if it is not already installed. It was developed by Derk Benisch, a systems engineer with the MSN Search group at Microsoft.[6] The Microsoft Robocopy GUI also includes version XP026 of Robocopy. When downloaded from the TechNet link below, the version reported is "Microsoft Robocopy GUI 3.1.1."

There are other non-Microsoft GUIs for Robocopy:

A copying program with a GUI, RichCopy, is also available on Microsoft's Technet. While it is not based on Robocopy, it offers similar features, and it does not require the installation of the .NET 2.0 framework.[10]

Versions

Product versionFile versionYearOriginOther
1.70-1997Windows NT Resource Kit
1.714.0.1.711997Windows NT Resource Kit
1.954.0.1.951999Windows 2000 Resource Kit
1.964.0.1.961999Windows 2000 Resource Kit(c) 1995-1997
XP0105.1.1.10102003Windows 2003 Resource Kit
XP0265.1.2600.262005Downloaded with Robocopy GUI v.3.1.2
XP0275.1.10.10272008Bundled with Windows Vista, Server 2008 and later(c) 1995-2004
6.16.1.76012009Bundled with Windows 7(c) 2009

See also

External links

Notes and References

  1. http://windowsitpro.com/Windows/Articles/ArticleID/44324/pg/2/2.html Robocopy XP010 FAQ Wield powerful new switch options.
  2. http://technet.microsoft.com/en-us/magazine/dd542631.aspx
  3. http://support.microsoft.com/kb/954404/en-us Robocopy Return Codes
  4. http://www.zdnet.com.au/blogs/snorage/soa/Microsoft-s-Robocopy-compromise/0,2000064373,339291041,00.htm Microsoft's Robocopy compromise
  5. http://msmvps.com/blogs/martinzugec/archive/2008/03/03/ugly-bug-in-robocopy-ignoring-security-on-file-level.aspx Ugly bug in Robocopy - ignoring security on file level
  6. News: Joshua Hoffman. Utility Spotlight Robocopy GUI. TechNet Magazine. Microsoft Corporation and CMP Media, LLC. November, 2006. 2008-07-17.
  7. http://www.upway2late.com/projects/winrobocopy WinRoboCopy, a GUI front end for RoboCopy.
  8. http://tribblesoft.com/easyrobocopy.aspx TribbleSoft: Easy RoboCopy
  9. http://www.sh-soft.com/front_content.php?idcat=7 SH-Soft Tools: Robocopy GUI
  10. News: Joshua. Hoffman. Free Utility: RichCopy, an Advanced Alternative to RoboCopy. TechNet Magazine. Microsoft Corporation and CMP Media, LLC. November, 2006. 2008-07-17.