Search code examples
multiple-instancesrobocopycloudberry

What happens if second instance of Robocopy started on same folder?


I have some SQL log backups scheduled to run every 15 minutes including a robocopy with the /MIR option, to an archive folder on a cloud storage volume using CloudBerry.

Sometimes after a Full backup, and a slow network, the full backup archive copy has not completed when the log backup is run, and I suspect a problem caused by the second robocopy now also trying to copy the large full backup file in addition to the new log backup.

What should happen? If the retry flag is set to /R:60, should the second instance somehow skip files already being copied by another robocopy instance, or will the two instances of robocopy step all over each other? Or must the second instance be run with the /R:0 option set to skip the first file still being copied?


Solution

  • I know this answer is a little late and I hope you found a solution but here are my 2 cents:

    Robocopy has an option to "monitor a source" for changes, I think it's the /MON and /MOT options. this would prevent robocopy from rerunning- it would always run in what is essentially a hot folder type scenario.

    From the help of robocopy:

             /MON:n :: MONitor source; run again when more than n changes seen.
             /MOT:m :: MOnitor source; run again in m minutes Time, if changed.