Robocopy only copy folders modified in last 7 days

Viewed 507

I'm trying to create a robocopy program that runs every Sunday and pulls in the last 7 days of folders(and its sub-folders) .this is because the folder stores years' worth of data so I only want to pull in the new folders. is there a way to do this? I've been playing around with the max/min age but its pulling in all folders

what i have so far:

robocopy \\myserver\test\main_folder \\myserver\test\main_folder_archive /MIR 

I want to run this every Sunday and it is smart enough to pull in the last 7 days.

Any help is appreciated, thanks

1 Answers

robocopy \server\source_share \server\dest_share /MAXAGE:7 /S /E

Should do it. This is not compatible with /MIR though:

/MIR :: Mirror a complete directory tree.

So either mirror, or select 7 days worth of files.

Edit: added /S, which is what I think was the desired switch instead of /MIR

Related