0
votes

I want to use robocopy /xo to isolate only newly modified files. After they are copied to the destination folder, I want to copy the files that were just copied to an empty folder.

I have already set up robocopy with maxage to try to catch files changed since yesterday (this repeats on the half hour) but I end up re-copying the same files even if they haven't changed. This is why I moved to the /xo switch. I understand the destination folder will have to have all the contents of the original directory in order to compare. However, I want whatever files are new to also be copied to a blank folder.

1
For example, if I have File 1, File 2, and File 3 in the original folder, and File 1 is modified an hour ago, my destination (call it destination 1) folder will get updated with the newer version of File 1 (It will have FIle 1, File 2, and File 3). Next, I want File 1 only to be copied to an empty folder (destination folder #2) because I've identified that it's the only one to have been updated. I still want to maintain the original destination folder to make sure my local machine is up-to-date. The last copy to empty folder is an additional step. - user3620676

1 Answers

0
votes

Run robocopy with the following options.

"maxage:1" makes robocopy to copy only files that are modified in the last 1 day.

"mir" is to mirror.

With "s" option, robocopy does not create directories which don't include any files modified in the last 1 days.

robocopy c:\source c:\destination /maxage:1 /mir /s