From LedHed's Wiki
Jump to: navigation, search
 
Line 1: Line 1:
== Examples ==
+
== General Notes ==
 +
Robocopy's default behavior is to only copy files that have changed (modified date or size).<br>
 +
This allows Robocopy to perform an incremental copy. This is useful when you need to copy a lot of data and that dataset is regularly changing. So you perform the initial copy, then at a later time repeat and only the data that couldn't be copied the first time (or data that has changed since) will be copied. This is very useful when moving data from one file server to another.
  
 +
 +
== Examples ==
  
 
  robocopy \\SERVER\D$\data D:\data /S /E /COPYALL /R:0 /W:0 /XD "\\SERVER\D$\data\Junk Folder" \\SERVER\D$\data\tmp
 
  robocopy \\SERVER\D$\data D:\data /S /E /COPYALL /R:0 /W:0 /XD "\\SERVER\D$\data\Junk Folder" \\SERVER\D$\data\tmp
Line 6: Line 10:
 
Copy from \\SERVER\D$\data to local D:\data
 
Copy from \\SERVER\D$\data to local D:\data
  
/S = Copy Subdirectories
+
/S = Copy Subdirectories<br>
/E =Include Empty Subdirectories
+
/E =Include Empty Subdirectories<br>
/COPYALL = Copy all file attributes
+
/COPYALL = Copy all file attributes<br>
/R:0 = Retry zero times on copy failures
+
/R:0 = Retry zero times on copy failures<br>
/W:0 = Wait 0 seconds between retries
+
/W:0 = Wait 0 seconds between retries<br>
/XD = Exclude Directories (Space separated list, make sure to properly quote paths that have spaces in them)
+
/XD = Exclude Directories (Space separated list, make sure to properly quote paths that have spaces in them)<br>
  
  

Latest revision as of 03:55, 26 July 2012

General Notes

Robocopy's default behavior is to only copy files that have changed (modified date or size).
This allows Robocopy to perform an incremental copy. This is useful when you need to copy a lot of data and that dataset is regularly changing. So you perform the initial copy, then at a later time repeat and only the data that couldn't be copied the first time (or data that has changed since) will be copied. This is very useful when moving data from one file server to another.


Examples

robocopy \\SERVER\D$\data D:\data /S /E /COPYALL /R:0 /W:0 /XD "\\SERVER\D$\data\Junk Folder" \\SERVER\D$\data\tmp

Copy from \\SERVER\D$\data to local D:\data

/S = Copy Subdirectories
/E =Include Empty Subdirectories
/COPYALL = Copy all file attributes
/R:0 = Retry zero times on copy failures
/W:0 = Wait 0 seconds between retries
/XD = Exclude Directories (Space separated list, make sure to properly quote paths that have spaces in them)


Be careful not to create a Junction Loop


References

http://technet.microsoft.com/en-us/library/cc733145%28v=ws.10%29.aspx