• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 9728
  • Last Modified:

ROBOCOPY files older than 30 days exclude folders

I am using robocopy to move files not accessed in 30 days:

ROBOCOPY "C:\_Test1" "C:\_TEST2" /move /minlad:0 /s

However, it is not quite doing what I need.  I want it to move files but leave all folders intact.

Thanks
0
hgj1357
Asked:
hgj1357
  • 2
1 Solution
 
hgj1357Author Commented:
..Also, overwrite duplicate files and recreate file structure in destination.
0
 
Lee IngallsDirector of IT/TS, Quality and FinanceCommented:
Have you tried ROBOCOPY "C:\_Test1" "C:\_TEST2" /move /minage:30 /s

/MINAGE:n Excludes files with a Last Modified Date newer than n days or specified date. If n is less than 1900, then n is expressed in days. Otherwise, n is a date expressed as YYYYMMDD.

/MOV Moves files (that is, deletes source files after copying).
/MOVE Moves files and directories (that is, deletes source files and directories after copying).

Reference the following link for complete Robocopy switches and usage...
http://compdocs.blogspot.com/2007/01/robocopy-switches.html
0
 
hgj1357Author Commented:
So the key here is using /MOV and not /MOVE

Thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now