Skip to content
Snippets Groups Projects
Commit e1b4a823 authored by Jérôme Charaoui's avatar Jérôme Charaoui
Browse files

borg: emit warning if rc=1, fixes #11311

parent 387eb85d
No related branches found
No related tags found
No related merge requests found
......@@ -175,9 +175,13 @@ debug "$nice $execstr"
if [ $test = 0 ]; then
output=`$nice su -c "$execstr" 2>&1`
if [ $? = 0 ]; then
ret=$?
if [ $ret = 0 ]; then
debug $output
info "Successfully finished backing up source."
elif [ $ret = 1 ]; then
warning "Backing up source finished with warnings, details below."
warning $output
else
error $output
fatal "Failed backing up source."
......@@ -196,12 +200,16 @@ if [ "$prune" == "yes" ]; then
debug "$prunestr"
if [ $test = 0 ]; then
output="`su -c "$prunestr" 2>&1`"
if [ $? = 0 ]; then
ret=$?
if [ $ret = 0 ]; then
debug $output
info "Removing old backups succeeded."
else
elif [ $ret = 1 ]; then
warning "Removing old backups finished with warnings, details below."
warning $output
warning "Failed removing old backups."
else
error $output
fatal "Failed removing old backups."
fi
fi
fi
......
  • Jérôme Charaoui @lavamind

    mentioned in merge request !51 (closed)

    ·

    mentioned in merge request !51 (closed)

    Toggle commit list
  • Developer

    @lavamind I think you cannot replace warning by fatal like that, because as I understand it, fatal will exit backupninja and the next handler will not be called. So I believe failure in removing old backup should be a warning, not a fatal error.

  • Author Maintainer

    @maethor fatal only exits the current handler, it's halt that causes other backup actions to be skipped, see https://0xacab.org/liberate/backupninja/-/blob/master/src/backupninja.in#L585

  • Developer

    OK, then it seems good to me.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment