Skip to content

Instantly share code, notes, and snippets.

@brunodesde1987
Forked from archagon/robocopy-backup
Created February 29, 2020 14:18
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 brunodesde1987/9d8aa2561511e140112856763926c871 to your computer and use it in GitHub Desktop.
Save brunodesde1987/9d8aa2561511e140112856763926c871 to your computer and use it in GitHub Desktop.
A bunch of robocopy flags to help backup an external drive.
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
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