More Command Line Switches for Robocopy
Last month, I blogged about some basic Robocopy functionality, available here. Here, I will discuss some of the more advanced switches of Robocopy.
/mir – This command will mirror the source to the target. This switch will copy all of the data from the source to the target, but this will also remove the files from the target that do not exist on the source. This is very similar to the /e and /purge switches, however, /mir will also overwrite the security information on the target files.
/mov – After files are copied to the target, this will switch remove from the source. This is just the files, not the directories.
/move – This command will move files and directories from the source to the target.
/create – This will copy the directory structure and create zero length files.
/a – This will only copies the files with the A attribute, or archive attribute.
/m – This will also only copies files with the A attribute, but it will then reset this attribute.
/log:<filename> – Creates or overwrites a logfile to log the files that are copied. Otherwise, it is just displayed on the screen.
/log+:<filename> – Same as /log, but the + will append to the end of the existing log file.
/mt:<threads> – Will modify the number of threads that Robocopy will use. By default, the command will use 8 threads. You can specify to use 1 to 128 threads in your copy jobs.