O Robocopy tem as opções /MINAGE
e /MAXAGE
. Use-os para especificar um intervalo de datas para a seleção de arquivos.
Consulte o link :
Move files over 14 days old
Move files over 14 days old (note the MOVE option will fail if any files are open and locked).
ROBOCOPY C:\SourceFoldern D:\DestinationFolder /move /minage:14
Similarly you could use the below switches
/maxage: <N> Specifies the maximum file age (to exclude files older than N days or date). /minage: <N> Specifies the minimum file age (exclude files newer than N days or date). /maxlad: <N> Specifies the maximum last access date (excludes files unused since N). /minlad: <N> Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD