#1096005 borgmatic borg does not correctly pass return code

Package:
borgmatic
Source:
borgmatic
Submitter:
Lee Garrett
Date:
2026-01-09 21:25:08 UTC
Severity:
normal
Tags:
#1096005#5
Date:
2025-02-15 01:39:36 UTC
From:
To:
Hello,

# borgmatic -c /etc/borgmatic.d/complete_system.yaml borg upgrade --show-rc --check-archives-tam
[...]
Archive TAM missing: batou_2022-10-19T16:28+02:00         Wed, 2022-10-19 18:30:22 [<<hash>>]
Archive TAM present: batou_2023-02-16T16:20+0100          Thu, 2023-02-16 16:21:08 [<<hash>>]
[...]
Found 20 archives with TAM issues!
terminating with warning status, rc 1
# echo $?
0

It seems as though `borgmatic borg ...` calls don't correctly pass the return
code of borg to the shell. Would be sensible to have for scripting purposes.

Greetings,
Lee

#1096005#10
Date:
2025-03-02 17:08:40 UTC
From:
To:
This is actually intentional. borgmatic is a wrapper for many
executables besides just Borg; it calls out to database clients,
filesystem snapshot software, and even arbitrary commands (in the form
of before_* and after_* hooks). So IMO it doesn't make sense to adopt
the return codes for only one of those executables. But what borgmatic
does offer is the ability to configure how different Borg exit codes are
interpreted as either warnings or errors. See
https://torsion.org/borgmatic/docs/how-to/customize-warnings-and-errors/
for more information.

Dan

#1096005#17
Date:
2025-06-03 21:15:01 UTC
From:
To:
(Not sure why I didn't get the reply, just saw it by chance on the web frontend.)

Now that you pointed me to those docs it kinda makes sense to not pass those
through. Those config settings should be enough to get it to work for my use
case. Thanks!

Greetings,
Lee