duplicacy icon indicating copy to clipboard operation
duplicacy copied to clipboard

Easier way to keep the last N snapshots, regardless of backup frequency

Open phretor opened this issue 8 years ago • 2 comments

The prune -keep n:m syntax is awesome, but in some use cases it might be desirable to simply say, "I want to retain the last N snapshots".

For instance, if I backup monthly, and I want to keep only the last snapshot, it would be prune -keep 0:31 (no snapshots older than 31 days), but if I backup daily, that has a different meaning.

Of course, this is just a tiny enhancement, nothing really important ;)

phretor avatar Jul 05 '17 07:07 phretor

This is a good idea. To avoid confusion, we should use a different option name, something like '-retain', instead of reusing '-keep'.

gilbertchen avatar Jul 05 '17 16:07 gilbertchen

This is a good idea. To avoid confusion, we should use a different option name, something like '-retain', instead of reusing '-keep'.

I submitted PR #669 today that adds a -keep-max option to the prune command. It requires a tag (-t) to be present and then it will keep the most recent n revisions matching the tag. The PR includes multiple examples, but here's one example:

duplicacy prune -t hourly -keep-max 24 # keep max 24 hourly revisions

leftytennis avatar Jun 28 '24 21:06 leftytennis