Borg 2 date-based matching flags for archive selection
Closedopened 2 months ago by witten · 7 comments
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
What I'm trying to do and why
Borg 2.0beta5 recently added support for date-based archive matching flags on several sub-commands:
--oldest. See for instance the borg rlist documentation.
As part of this ticket, implement these flags on relevant borgmatic actions and plumb them through to the appropriate
borgmatic/borg/*.pycode so they make their way to Borg.
I personally find the descriptions of these flags in Borg's
--helpa little confusing, so consider coming up with simpler phrasing for documenting the borgmatic versions of these flags.
These flags can be Borg 2 only and documented as such. E.g.: "(Borg 2.x+ only)" in the description of each flag. There's no need to enforce that they only run with Borg 2 IMO.
I'll check this one.
--lastflags are not implemented for some actions like
prune. Should I add these timespan flags to such actions?
add_argument()in arguments.py is passing the required flags correctly (checked rlist) so unless we want to enforce version there doesn't seem to need of modifying
borgmatic/borg/rlist.pyaccording to #298.
You're talking about adding
--lastflags to relevant borgmatic actions as part of this ticket? Sure, if you want to add those while you're adding the other flags, that'd be great!
Yeah, it looks like
flags.make_flags_from_arguments(), which should handle passing the newly added flags to Borg. But that may or may not be the case for other borgmatic actions.
Is there any specific reason
make_flags_from_arguments()isn't used on every action? I'm working on the PR and have left the borg files untouched which are used this function and passed all arguments in others to make
It could probably be used in more places than it is, but
make_flags_from_arguments()doesn't currently handle:
createaction has a lot of this for instance.
Having said all that though, feel free to use
make_flags_from_arguments()wherever it makes sense / saves you typing.
Just released as part of borgmatic 1.7.14!
Thank you for bearing with me and your continuous help! :)