Use of the borg option "--max-duration" in borgmatic is not behaving as expected. #814
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#814
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
Hopefully this is a simple case of user error. I'm trying to pass the borg option of
--max-duration
into borgmatic withextra_borg_options
, but it's not working as I would have hoped.Steps to reproduce
Run
borgmatic check --override checks.name=repository --override extra_borg_options.check="--repository-only --max-duration=3600" --only repository
I've tried multiple variants of the command, with and without single and double quotations.
Actual behavior
This error is generated.
Expected behavior
A repository check runs for 3600 seconds.
Other notes / implementation ideas
The borg version of this command runs fine.
borg check myrepository --repository-only --max-duration=3600
Config file
borgmatic version
1.8.6
borgmatic installation method
pip install
Borg version
1.2.4
Python version
3.11.2
Database version (if applicable)
No response
Operating system and version
Debian GNU/Linux 12 (bookworm)
Thanks for providing the detailed bug report! It looks like there are at least two things wrong here, one with the command you're running and one with borgmatic itself:
--override checks.name=repository
try--override checks=[{name: repository}]
. Or even better, don't use--override
at all and just use theborgmatic check --only
flag, e.g.--only repository
Please let me know if one of the above solutions works for you! As far as I can tell, the problem you're seeing has nothing to do with your use of
--max-duration
. I'll note that you shouldn't need--repository-only
because borgmatic will pass that to Borg implicitly if you go with one one of the solutions described above.Also, what do you think of borgmatic supporting
--max-duration
natively, either as a configuration option or a command-line flag or both?Thanks! This seems to do what I want
borgmatic check --only repository --override extra_borg_options.check="--max-duration=3600"
. I appreciate your help.The command-line reference documentation indicates that overrides should be invoked by
--override OPTION.SUBOPTION=VALUE
which is why I formatted it the way I did. Not sure if the documentation needs to be updated or I interpreted it incorrectly, I'm not a power user by any means.I also included the
--override
call because I don't have a repository check in my config file, so I thought I would have to include that in the command line. What I now gather from your comment is that the command line options will add functionality not included in the config file.I think supporting
--max-duration
natively in both/either the config and command line won't hurt anything, I personally would like to be able to run any borg command from borgmatic natively, but that's probably a tall order. The only potential hiccup I see with--max-duration
is that it can only be run on repositories, so if there were additional checks in the configuration, they would have to be called separately from repository checks within borgmatic.Thanks, that makes sense! I've filed #817 for the native
--max-duration
feature. Feel free to follow along there.Yeah, the command-line help necessarily isn't as extensive as the online docs: https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#configuration-overrides
But maybe the command-line help can be expanded a bit.
Released in borgmatic 1.8.7!
Nice!