Robocopy (Robust File Copy)



 

General

A command method commonly used to transfer data from one storage array to another. To batch copy large numbers of folders, sub-folders and all their contents. This command will actively mirror one location to another (which is a better method than drag and drop from Windows Explorer for complex file arrangements).  It can also provide a report on files /directories failed to copy.

 

When to use

In cases with complex folder structures, large file sizes and with lots of individual files. For a single 1 GB file, one should just use windows drag and drop. A good use case example for this command is the Thresher project: approximately 900 GB content, spread across close to 3,000 sub-folders and over 80,000 individual files. If an interruption in the transfer operation occurs, this structure is too complex to figure out where in the process the interruption happened. The robocopy command allows recovery options to auto-start where the transfer process was stopped (/z  option) as well report detail status (/v option).

 

Tips

 

Note on processing time

 

 

Command and options

 

robocopy source-path destination-path /z /v /e /log:C:\myLog.txt /tee /fp /w:5

 

 

Options

 

/z

Copies files in Restart mode. (Key for restoring copy function if operation is interrupted or incomplete for any reason. )

/v 

Produces verbose output, and shows all skipped files. (see screen shot below)

/e

Copies sub-directories. Note that this option includes empty directories.

/log:<LogFile> 

Writes the status output to the log file (overwrites the existing log file).

/tee

Writes the status output to the console window, as well as to the log file. (helpful to view onscreen for quick view of status. shows exactly where in the cue the operation is. Can also check the destination folder fpr increase in overall size)

/fp

Includes the full path names of the files in the output.

/w:<N>

Specifies the wait time between retries, in seconds. The default value of N is 30 (wait time 30 seconds).

/s Copies sub-directories. Note that this option excludes empty directories. (good practice is to use /e and capture all directories, especially from donations or gifts when contents is unknown)

 

Figure: Example of Output Report (/v)

 

 

 

Local Example

 

robocopy Z:\Thresher\2012-project-1916-2000\thresher-1983-2000\  F:\thresher-1983-2000\ /z /v /e /log:Z:\Thresher\2012-project-1916-2000\myLog.txt /tee /fp /w:5

 

Source = Z:\Thresher\2012-project-1916-2000\thresher-1983-2000\
Target = F:\thresher-1983-2000\

 

For more information on other Robocopy Options and Switches