Robocopy

From Piszczynski
Revision as of 14:13, 15 July 2023 by piszczynski>Aleks (Created page with " == Robocopy == [https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy MS KB] Use robocopy to copy files when performance and security are...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Robocopy

MS KB Use robocopy to copy files when performance and security are required.

  • robocopy <source> <destination>

use /e for all directories recursively use /mir if you want all the files to match from source to destination (will delete any files not the same)

Clone Disk

If you need to clone a disk make sure to copy all permissions and attributes of the files with all folders from the root directory:

  • robocopy <source> <destination> /copyall /e /xd "System Volume Information" /log:<log_file_path> /mt
  • robocopy F:\ G:\ /copyall /e /xd "System Volume Information" /log:C:\temp\logfile.log /mt

Large Data Transfer

When transferring large amounts of files make sure to use the /mt switch to enable multi threaded performance. The default is for 8 threads but you can specify more with a number after the switch: /mt:16 for 16 threads etc.