Robocopy File Classes
For each directory processed Robocopy constructs a list of files matching the Include Filespecs, in both the source and destination directories. The program then cross-references these lists, seeing which files exist where, comparing file times and sizes where possible, and places each selected file in one of the following classes :
Exists inExists inSource/DestSource/Dest
File ClassSourceDestinationFile TimesFile Sizes
LonelyYesNon/an/a
SameYesYesEqualEqual
ChangedYesYesEqualDifferent
NewerYesYesSource > Destn/a
OlderYesYesSource < Destn/a
ExtraNoYesn/an/a
MismatchedYes ( file)Yes (directory)n/an/a
By default, Changed, Newer and Older files will be considered to be candidates for copying (subject to further filtering described below), Same files will be skipped (not copied), and Extra and Mismatched files (and directories) will simply be reported in the output log.
Use the following switches to override this default behaviour :
/XLeXclude Lonely files
/ISInclude Same files
/XCeXclude Changed files
/XNeXclude Newer files
/XOeXclude Older files
Use the following switch to suppress the reporting and processing of Extra files :
/XXeXclude eXtra files
To just make sure the destination tree includes the current version of all source files, you do not need to specify any of these arguments. Robocopy's default behaviour will be all you need for most situations.
Use /XO with caution. If you terminate Robocopy whilst it is copying, any incompletely copied file will almost certainly have a later file time than the source file. If you restart the same copy, Robocopy will see this file as an Older file, and will skip it if you use /XO. Bear this in mind if you are using /XO and need to kill a copy. The most appropriate use for /XO is to synchronise two directory trees that can each be updated simultaneously in disjoint areas. Using /XO and copying first in one direction, and then the other, will ensure that the latest files are present in both directory trees.
Note that specifying /XL restricts the program to copying files from the source directory tree only if a corresponding file of the same name already exists in the destination. This provides a convenient mechanism for maintaining a copy of a selected subset of the source tree.
Also note that specifying /IS on its own with no other selection switches forces a total refresh of the destination tree, should you ever need to do this.