Check return codes of Borg #52

Closed
opened 2018-01-14 09:29:28 +00:00 by henfri · 1 comment

Currently it seems that borgmatic is not checking the return code of borg, e.g.

            create.create_archive(
                args.verbosity,
                repository,
                location,
                storage,
            )

In create_archive subprocess.check_call() is used that should throw an exception if borg is not successful, but I see no handling of this exception.

Currently it seems that borgmatic is not checking the return code of borg, e.g. create.create_archive( args.verbosity, repository, location, storage, ) In create_archive subprocess.check_call() is used that should throw an exception if borg is not successful, but I see no handling of this exception.
witten added the
question / support
label 2018-01-15 00:04:57 +00:00
Owner

This exception should actually be handled already! Here's the code that does it: https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/commands/borgmatic.py#L138

For instance, here's the output of a borgmatic run with a Borg error:

$ borgmatic -c test.yaml 
...
Command '('borg', 'prune', 'user@backupserver:sourcehostname.borg', '--keep-within', '3H', '--keep-minutely', '60', '--keep-hourly', '24', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--keep-yearly', '1', '--prefix', 'sourcehostname', '--remote-path', 'borg1')' returned non-zero exit status 2

If you find that there is some exception or Borg error that is not handled like that, please let me know.

This exception should actually be handled already! Here's the code that does it: https://projects.torsion.org/witten/borgmatic/src/branch/master/borgmatic/commands/borgmatic.py#L138 For instance, here's the output of a borgmatic run with a Borg error: ``` $ borgmatic -c test.yaml ... Command '('borg', 'prune', 'user@backupserver:sourcehostname.borg', '--keep-within', '3H', '--keep-minutely', '60', '--keep-hourly', '24', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--keep-yearly', '1', '--prefix', 'sourcehostname', '--remote-path', 'borg1')' returned non-zero exit status 2 ``` If you find that there is some exception or Borg error that is not handled like that, please let me know.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#52
No description provided.