0

Is there a way to utilize Robocopy to target only files/folders that were modified within a certain time range? For example, if there is a file share with n-number of folders/files dating back several years, how would I target only the ones that were modified within the last one month or so and have the deltas copied over? I do not want it iterating throughout the entire share during the Robocopy process, but only targeting the recently changed files.

  • 2
    What's wrong on the /MAXAGE:n parameter? (MAXimum file AGE - exclude files older than n days/date.) – JosefZ Oct 14 '19 at 16:14
  • But does it iterate through every file to find that age? – Helene Oct 14 '19 at 20:06
0

From the robocopy docs:

/MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date.
/MINAGE:n :: MINimum file AGE - exclude files newer than n days/date.
/MAXLAD:n :: MAXimum Last Access Date - exclude files unused since n.
/MINLAD:n :: MINimum Last Access Date - exclude files used since n.
             (If n < 1900 then n = n days, else n = YYYYMMDD date).

if you needed to get files that were accessed in the last month you would use:

robocopy <source_dir> <destination_dir> /MAXLAD:30 /S /Z /B
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.