borgmatic configuration syntax for more granular exit codes (borg_exit_codes / exit_code / treat_as) on website does not match application syntax #1094
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#1094
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
I'm trying to ensure that if borg encounters an error, borgmatic will not ignore/hide it.
This in reference to another ticket I have created,
No error when one my source_directories is not mounted; default value of option 'source_directories_must_exist'
To archieve this, I am following the instructions on:
borgmatic - How to customize warnings and errors - More granular configuration
Steps to reproduce
I've added the following configuration to my borgmatic configuration file:
and run borgmatic:
Actual behavior
I get the following error:
Expected behavior
I had expected this parameter to be correct.
Other notes / implementation ideas
I've tried replacing the key 'exit_code' with 'code', and this seems to work (i.e. the configuration syntax is accepted), which makes me believe that there is a mismatch between the code and the documentation describing the syntax.
borgmatic version
2.0.5
borgmatic installation method
pipx
Borg version
borg 1.4.1
Python version
Python 3.11.2
Database version (if applicable)
No response
Operating system and version
Debian GNU/Linux 12 (bookworm)
Welp, looks like the docs are just plain wrong! Change
exit_code:tocode:and it should work for you. I'll update the docs.Fixed in main! The updated docs should be live shortly. Thank you!
Another small remark: The tab-size / indent on that website is 3 spaces, where on the other pages it is '4'
I believe the following text on that same page is not correct anymore since Borg 1.4:
Borg (>=1.4) returns extra warning exit codes (in the range 100..107) in addition to 'code: 1'. These warning exit codes won't match 'code==1', and thus won't make borgmatic elevate all warnings into an error.
I don't see any other way to elevate all warnings (code 1,100..107) into an error, other than to specify each of them:
Fixed, thank you!
Good catch! I'll clarify that that approach is only for Borg < 1.4.
That's correct.