Robocopy

From Wikipedia, the free encyclopedia - View original article

Robocopy
Developer(s)Microsoft
Stable release6.1
Operating systemWindows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, Windows Server 2012
LicenseProprietary
 
Jump to: navigation, search
Robocopy
Developer(s)Microsoft
Stable release6.1
Operating systemWindows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, Windows Server 2012
LicenseProprietary

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. The command is robocopy.

Features[edit]

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

Limitations[edit]

No open files[edit]

Robocopy will not copy open files. Any process may open files for exclusive read access by withholding the FILE_SHARE_READ[4] flag during opening. Even robocopy's Backup mode will not touch those files. (Backup mode instead runs Robocopy as a "Backup Operator". This allows Robocopy to override permissions settings (specifically, NTFS ACLs).[5] [6])

The Windows Volume Shadow Copy service is used for such situations, but Robocopy does not use it. Therefore Robocopy is not useful for backing up live operating system volumes. However, one can use a separate utility, such as GSCopyPro or DiskShadow.exe[7] (included with Windows Server 2008), to create a shadow copy of a given volume, which Robocopy can then be directed to back up.

XP mirroring bug[edit]

Robocopy versions on systems older than Windows Vista do not mirror properly. They ignore changed security attributes of previously mirrored files.[8] [9]

Wildcarding treatment[edit]

The /XF switch does not work if given both a directory and a wildcard. For example /XF pictures\*.jpg generates an error.

Common usage scenarios[edit]

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.[10]

Folder copier, not file copier[edit]

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[edit]

Robocopy's "inter-packet gap" (IPG) option allows some control over the network bandwidth used 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={B_{A}-B_{D} \over B_{A}\times B_{D}}\times 512\times 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 used by Windows Update and BranchCache).

GUI front-end[edit]

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.[11] 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. [15]

Versions[edit]

Note: Several versions of Robocopy do not show the version number when executing Robocopy /? on the command line.

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, Windows 7(c) 1995-2004
6.16.1.76012009KB2639043(c) 2009
6.26.2.92002012Bundled with Windows 8(c) 2012
6.36.3.96002013Bundled with Windows 8.1(c) 2013

See also[edit]

References[edit]

  1. ^ "Robocopy XP010 FAQ". Windowsitpro.com. 2004-11-15. Retrieved 2012-11-11. 
  2. ^ "Multi-threaded robocopy for faster copies - Grant Holliday's Blog - Site Home - MSDN Blogs". Blogs.msdn.com. 2009-10-23. Retrieved 2012-11-11. 
  3. ^ "Return codes that are used by the Robocopy utility in Windows Server 2008 or Windows Server 2008 R2". Support.microsoft.com. 2012-02-17. Retrieved 2012-11-11. 
  4. ^ http://msdn.microsoft.com/en-us/library/aa363858.aspx "CreateFile function". MSDN. "FILE_SHARE_READ [...] Enables subsequent open operations on a file or device to request read access. Otherwise, other processes cannot open the file or device if they request read access." 
  5. ^ "Robocopy.exe - Robust File Copy Utility - Version XP010". "Backup mode copies [...] enable you to copy some files as a Backup Operator that you would not be able to copy as a normal user." 
  6. ^ "Default groups". Microsoft TechNet. "Backup Operators [...] Members of this group can back up and restore all files [...], regardless of their own individual permissions on those files." 
  7. ^ "Diskshadow". Microsoft TechNet. Retrieved 2013-03-06. "DiskShadow.exe is a tool that exposes the functionality offered by the Volume Shadow Copy Service (VSS)." 
  8. ^ "Microsoft's Robocopy compromise". ZDNet. 2008-08-04. Retrieved 2012-11-11. 
  9. ^ "Ugly bug in Robocopy - ignoring security on file level - Martin Zugec blog". Msmvps.com. 2008-03-03. Retrieved 2012-11-11. 
  10. ^ "Robocopy". Technet.microsoft.com. Retrieved 2012-11-11. 
  11. ^ Joshua Hoffman (November 2006). "Utility Spotlight Robocopy GUI". TechNet Magazine (Microsoft Corporation and CMP Media, LLC). Retrieved 2008-07-17. 
  12. ^ "WinRoboCopy - UpWay2Late.com Software". Upway2late.com. Retrieved 2012-11-11. 
  13. ^ "Easy RoboCopy". TribbleSoft. Retrieved 2012-11-23. 
  14. ^ "SH-RoboCopy GUI". SH-Soft. Retrieved 2012-11-23. 
  15. ^ Hoffman, Joshua (November 2006). "Free Utility: RichCopy, an Advanced Alternative to RoboCopy". TechNet Magazine (Microsoft Corporation and CMP Media, LLC). Retrieved 2008-07-17. 

External links[edit]