ROBOCOPY is a command-line file replication utility. The name robocopy is a concatenation of “Robust Copy”, a fitting description, as it exceeds the capabilities of the built-in Windows copy and xcopy commands, and is designed to be very efficient at mirroring files and directories.
only copy the top n LEVels of the source directory tree.
copy files in restartable mode.
copy files in Backup mode.
use restartable mode; if access denied use Backup mode.
copy using unbuffered I/O (recommended for large files).
copy all encrypted files in EFS RAW mode.
what to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info).
copy files with SECurity (equivalent to /COPY:DATS).
COPY ALL file info (equivalent to /COPY:DATSOU).
COPY NO file info (useful with /PURGE).
FIX file SECurity on all files, even skipped files.
FIX file TIMes on all files, even skipped files.
delete dest files/dirs that no longer exist in source.
MIRror a directory tree (equivalent to /E plus /PURGE).
MOVe files (delete from source after copying).
MOVE files AND dirs (delete from source after copying).
add the given Attributes to copied files.
remove the given Attributes from copied files.
CREATE directory tree and zero-length files only.
create destination files using 8.3 FAT file names only.
turn off very long path (> 256 characters) support.
MONitor source; run again when more than n changes seen.
MOnitor source; run again in m minutes Time, if changed.
Run Hours – times when new copies may be started.
check run hours on a Per File (not per pass) basis.
Inter-Packet Gap (ms), to free bandwidth on slow lines.
copy symbolic links versus the target.
Do multi-threaded copies with n threads (default 8). n must be at least 1 and not greater than 128. This option is incompatible with the /IPG and /EFSRAW options. Redirect output using /LOG option for better performance.
what to COPY for directories (default is /DCOPY:DA). (copyflags : D=Data, A=Attributes, T=Timestamps).
COPY NO directory info (by default /DCOPY:DA is done).
copy files without using the Windows Copy Offload mechanism.
Note: Using /PURGE or /MIR on the root directory of the volume will cause robocopy to apply the requested operation on files inside the System Volume Information directory as well. If this is not intended then the /XD switch may be used to instruct robocopy to skip that directory.
File Selection Options
copy only files with the Archive attribute set.
copy only files with the Archive attribute and reset it.
Include only files with any of the given Attributes set.
eXclude files with any of the given Attributes set.
/XF file [file]…
eXclude Files matching given names/paths/wildcards.
/XD dirs [dirs]…
eXclude Directories matching given names/paths.
eXclude Changed files.
eXclude Newer files.
eXclude Older files.
eXclude eXtra files and directories.
eXclude Lonely files and directories.
Include Same files.
Include Tweaked files.
MAXimum file size – exclude files bigger than n bytes.
MINimum file size – exclude files smaller than n bytes.
MAXimum file AGE – exclude files older than n days/date.
MINimum file AGE – exclude files newer than n days/date.
MAXimum Last Access Date – exclude files unused since n.
MINimum Last Access Date – exclude files used since n. (If n < 1900 then n = n days, else n = YYYYMMDD date).
eXclude Junction points. (normally included by default).
assume FAT File Times (2-second granularity).
compensate for one-hour DST time differences.
eXclude Junction points for Directories.
eXclude Junction points for Files.
Robocopy Retry Switches
number of Retries on failed copies: default 1 million.
Wait time between retries: default is 30 seconds.
Save /R:n and /W:n in the Registry as default settings.
wait for sharenames To Be Defined (retry error 67).
Robocopy Log Options
List only – don’t copy, timestamp or delete any files.
report all eXtra files, not just those selected.
produce Verbose output, showing skipped files.
include source file Time Stamps in the output.
include Full Pathname of files in the output.
Print sizes as bytes.
No Size – don’t log file sizes.
No Class – don’t log file classes.
No File List – don’t log file names.
No Directory List – don’t log directory names.
No Progress – don’t display percentage copied.
show Estimated Time of Arrival of copied files.
output status to LOG file (overwrite existing log).
output status to LOG file (append to existing log).
output status to LOG file as UNICODE (overwrite existing log).
output status to LOG file as UNICODE (append to existing log).
output to console window, as well as the log file.
No Job Header.
No Job Summary.
output status as UNICODE.
Robocopy Job Options
take parameters from the named JOB file.
SAVE parameters to the named job file
QUIT after processing command line (to view parameters).