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