Syncronize script with delete, but only delete older than n days

Advertisement

WEHA
Joined:
Posts:
1
Location:
Belgium

Syncronize script with delete, but only delete older than n days

Hello

I've been running a script to sync backups to another location with a delete parameter so I have the same folder on both sides.
Now to be able to withstand a cryptolocker attack I would like the sync to only delete files in the secondary folder that have a certain age.
I have seen posts about similar behavior but I don't want to just remove any file older than n days but only the ones that have been deleted from the source folder.
So if I have an old backup of something, it would remain in place.

thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

Re: Syncronize script with delete, but only delete older than n days

You can run the synchronize once without the -delete switch.
And then again with -delete -filemask=*<nD.

Reply with quote

Advertisement

You can post new topics in this forum