Easier way to keep the last N snapshots, regardless of backup frequency
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 ;)
This is a good idea. To avoid confusion, we should use a different option name, something like '-retain', instead of reusing '-keep'.
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