I would like to mirror a folder, but only delete files in the destination folder older than 7 days.
- 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
/xxoption to mirror Folder A to Folder B each day
Delage32to 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