Sunday, July 2, 2017

windows - Mirroring a folder without deleting files in destination less than n days old

I would like to mirror a folder, but only delete files in the destination folder older than 7 days.




Situation:




  • Folder A is mirrored to Folder B.

  • A file from Folder A is deleted



I would like for that file to remain in Folder B for 7 days. After 7 days the file would be deleted if it still does not exist in Folder A.




Current solution – in a batch file:




  • Use robocopy with the /mir and /xx option to mirror Folder A to Folder B each day

  • Use Delage32 to delete files and empty folders older than 7 days.



The problem is files (those I want to keep) are constantly being deleted and rewritten daily.



Is there a way to have the mirroring process look for extra files in the destination directory, and only delete them if they are older than 7 days? I would like to eliminate delage32.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...