Use of the borg option "--max-duration" in borgmatic is not behaving as expected. #814
Labels
No labels
blocked
breaking
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 a new issue
No description provided.
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
Hopefully this is a simple case of user error. I'm trying to pass the borg option of
--max-durationinto 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 repositoryI'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=3600Config 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=repositorytry--override checks=[{name: repository}]. Or even better, don't use--overrideat all and just use theborgmatic check --onlyflag, e.g.--only repositoryPlease 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-onlybecause 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-durationnatively, 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=VALUEwhich 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
--overridecall 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-durationnatively 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-durationis 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-durationfeature. 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!