Using ROBOCOPY to Transfer Large Amounts of Data
Using ROBOCOPY to Transfer Large Amounts of Data
I wanted to throw out the ROBOCOPY
command I’ve used a number of times to transfer large amounts of data between Windows-based servers. You’ll find all sorts of various answers if you search the internet, so I figured I’d add my into the mix.
ROBOCOPY “source” “destination” /E /XJ /MT:32 /R:2 /W:5 /COPY:DAT /LOG:”<log location>”
Here’s a break-down of each flag and its intended purpose.
Attribute | Meaning |
---|---|
source | The folder you wish to copy. |
destination | The folder you wish to copy your data too. |
/E | Copy subdirectories (including empty directories) |
/XJ | Exclude junction points. Equivalent to soft links in linux. |
/MT:32 | Increases multi-threading from the default of 8 to 32. Useful for small files at the cost of IO and CPU |
/NP | Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed. |
/R:2 | The number of reties when a file fails to successfully copy. |
/W:5 | How long to wait in between retries for copies. |
/COPY:DAT | Copy the following attributes of the files/folders: Data, Attributes and Timestamp |
/LOG:" |
Log all command output for later inspection. |
If used unmodified, it will copy all files including the files/folders permissions, timestamps and attributes.