Skip to content

Instantly share code, notes, and snippets.

@mohitt
Last active January 1, 2016 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohitt/d7f904fdc573e1807e64 to your computer and use it in GitHub Desktop.
Save mohitt/d7f904fdc573e1807e64 to your computer and use it in GitHub Desktop.
Robocopy
Robocopy C:\Users\mohit_thakral\ \\Desktop-da2t7v9\c\LaptopBackup\C-Drive\Users\mohit_thakral\ /MT:100000 /sl /xjd /xa:s /e /eta /tee /fp /a-:hs /b /MIR /R:0 /Z /XF *.iso *.log *.au C:\Users\mohit_thakral\NTUSER.DAT "C:\Users\mohit_thakral\Documents\Outlook Files\LocalEmails - Copy.pst" /LOG:M:\C-drive-backup4.log /XD C:\Users\mohit_thakral\AppData .android .AndroidStudio1.2 .babun C:\Users\mohit_thakral\Dropbox C:\Users\mohit_thakral\OneDrive
robocopy /b /e /xa:s /xjd /sl /a-:hs /mt /v /fp /eta /log:"D:\To\Directory\transfer.log" /tee "C:\From\Directory" "D:\To\Directory"
(Note that the paths don't have a trailing backslash.)
/b -- backup mode (there's a /zb option for restart mode, but it's a whole lot slower)
/e -- copies subdirectories (including empty directories) in addition to files
/xa:s -- exclude system files
/xjd -- exclude junction points
/sl -- copy symbolic links as links
/a-:hs -- remove hidden/system attributes from files
/mt -- multithreaded
/v -- verbose output + skipped
/fp -- full path of files in output
/eta -- time remaining
/log:logfile.txt -- redirect output to file
/tee -- duplicate log to console window
/XD -- Exclude Directory
/xf -- exclude files
By default, data, attributes, and time stamps are copied. ACL permissions, owner information,
and auditing information are ignored. (You can modify this behavior with the /copy flag.)
Some potentially helpful regexes for the log:
^\s*New File.*?\n
^\s*?\d+[%].*?\n
^\s*New Dir.*?\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment