Skip to content

Customizable pruning #6266

@gkleen

Description

@gkleen

There are several open issues wrt. adding flexiblity/additional options to pruning:

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions