Borg 2 date-based matching flags for archive selection
#659
Closed
opened 2 months ago by witten
·
7 comments
Loading…
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:
--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/*.py
code so they make their way to Borg.I personally find the descriptions of these flags in Borg's
--help
a 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
--first
and--last
flags are not implemented for some actions likecheck
andprune
. 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.py
according to #298.You're talking about adding
--first
and--last
flags 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.py
callsflags.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_command
It could probably be used in more places than it is, but
make_flags_from_arguments()
doesn't currently handle:create
action 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! :)