-
-
Notifications
You must be signed in to change notification settings - Fork 823
Description
There are several open issues wrt. adding flexiblity/additional options to pruning:
- Advanced filtering for borg prune #5720
- prune option keep quarterly #4750
- Tagging archives for "prune"? #846
As an inbetween suggestion, that might be easier to implement and use than tags, I offer the following:
Add a flag --keep-stdio (open to bikeshedding) to borg prune.
When given the flag, borg would behave like borg list --json <repo> && jq -r '.[]' | xargs -I '{}' -- borg delete <repo>::{} but with proper locking.
I.e.: borg would list all archives including some metadata (like timestamps) to stdout and expect a json list of archive names (or better: ids) on stdin. It would then keep all archives thus returned.
Any additional behaviour loaded unto prune (e.g. deleting superseded \.checkpoint(\.[0-9]+)?$-archives) would be unaffected.
The intended usage would be to wrap a call to borg prune --prune-stdio in a python script that implements whatever insane backup rotation strategy I want that week.
Would a pull request implementing this feature be welcome/have any chance of being merged eventually? (If I find the time to prepare one, of course)