Borg 2 date-based matching flags for archive selection #659
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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:
--newer/--older/--newest/--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.
It seems
--firstand--lastflags are not implemented for some actions likecheckandprune. Should I add these timespan flags to such actions?Also,
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 modifyingborgmatic/borg/rlist.pyaccording to #298 (comment).You're talking about adding
--firstand--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
borgmatic/borg/rlist.pycallsflags.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 makefull_commandIt 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! :)