robocopy /Z
= "copy files in restartable mode".
What does this option do? All the documentation I've found simply quotes the on-board manual. What is "restartable" mode, why would someone use it, and how does it differ from "Backup mode" (/B
) ?
robocopy /Z
= "copy files in restartable mode".
What does this option do? All the documentation I've found simply quotes the on-board manual. What is "restartable" mode, why would someone use it, and how does it differ from "Backup mode" (/B
) ?
Restartable mode (/Z) has to do with a partially-copied file. With this option, should the copy be interrupted while any particular file is partially copied, the next execution of robocopy can pick up where it left off rather than re-copying the entire file.
That option could be useful when copying very large files over a potentially unstable connection.
Backup mode (/B) has to do with how robocopy reads files from the source system. It allows the copying of files on which you might otherwise get an access denied error on either the file itself or while trying to copy the file's attributes/permissions. You do need to be running in an Administrator context or otherwise have backup rights to use this flag.
Please be aware:
When using restartable mode /Z or /ZB (/ZB try to use restartable mode, if can't, use backup mode), this mode assumes that source file is ready to copy. If file is being generated (ie: compressed file automation and launch copy before completes -time of day-, will result to a corrupted target file). I faced this when automated the compression of backup files on other computer (remote) and the compression should finish at 9:00pm, so I programmed copy that file at 9:30pm... apparently everything was copied ok, no errors, but copied file results corrupted because due to other tasks used on that remote computer at the time, the compression took 45 minutes more. This way the compressed file was still in progress when robocopy /zb started (was using restartable mode due to no issues to use it), the compressed file still in progress for 15 more minutes.
Removed the /ZB and, since this, I use /B only. In backup mode ( /B ) Robocopy try to read the file exclusively. If source file is not ready yet, Robocopy fails and retry, after 30 seconds, as many times as you specified with /R parameter. I use /R:100