Give the ability to supply additional Borg options #427
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#427
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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 has additional options like
--bypass-lock
. This option is dangerous to use in general, i.e. using it to allow multiple producers to write to repository is a big bang. Don't do this. However, for read-only operations (e.g.info
,list
,mount
, etc.), even during archive creation, it's totally fine (see also https://github.com/borgbackup/borg/issues/5261).The above is just an example, there are other useful options as well. But let's continue with the above one for the sake of example.
I need a way to invoke both
info
andlist
exactly in that order for each repository using--bypass-lock
option as well. Currently, there are multiple issues at play here.First of all, if we use regular
borgmatic ... info ... list ...
, thenborgmatic
, that islist
will always be called beforeinfo
, and hence, appear in the output before. I think this should be changed to follow the order on the command line as it matters (in the current case for presentation purposes, but in other cases might matter logically). As a side question here, when invoked asborg ... info ... list ...
, I see that Borg processes these in one go. Is there any particular reason why Borgmatic splits those into two separate invocations? I'm asking because this also affects the order and is another way to fix the described issue.--bypass-lock
. To support that, there should either be a way to supply those common Borg options for anyborgmatic
command in general and/or at the very leastinfo
andlist
should be added into theextra_borg_options
dictionary (though the issue will still facilitate itself for any other/future commands not in the dictionary).info
andlist
appear per repository is interleaved. This is good and expected as it's important to present information aggregated per repository. The only issue is still from the first point aboutlist
coming beforeinfo
.Secondly, due to two issues described above, I tried to resort to the new
borgmatic ... borg ...
command, here is my feedback on it:borg ...
invocation thoroughly. As a result, it's not possible to run eitherborgmatic ... borg info ... list ...
orborgmatic ... borg info ... borg list ...
. This immediately leads to impossibility to displayinfo
andlist
per repository interleaved. As invoking them separately will aggregate firstinfo
for all repositories and thenlist
for all repositories. The only good part is that--bypass-lock
option is accepted though only afterinfo
orlist
, which is semantically not the right place for such common Borg options. I think parsing can be improved by introducing special delimiters which would allow both options in front of Borg commands and multiple Borg commands to appear in one invocation, e.g.borgmatic ... borg [borgmatic borg options] -- [common borg options] info ... --- [borgmatic borg options] -- [common borg options] list ... ---- borg [borgmatic borg options] -- [common borg options] create ... --- [borgmatic borg options] -- [common borg options] prune ...
. So--
ends Borgmatic options, regular convention,---
separates multiple Borg commands within oneborg
invocation,----
return back to Borgmatic, so it can either run Borgmatic command(s) or run new Borg command(s) again.Environment
borgmatic version:
1.5.15
Borg version:
1.1.16
Python version:
3.9.1
For point 2 above, there are existing options that almost support that:
However that doesn't yet support
list
orinfo
. However it wouldn't be difficult to add that support!Also, borgmatic doesn't parse each
borg
action thoroughly. However it does at minimum need to parse out that Borg command. That's because borgmatic needs to pass the borgmatic--repository
and--archive
to Borg in the right spot in the constructed command-line—or else Borg blows up.