From 6c14106951a325384157f2f6c65c6f0b48d8db83 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Sun, 24 Oct 2021 23:10:32 -0400 Subject: [PATCH] don't treat restic warning as a failure it's normal for files to be added and delted on the target server as it's backing up, so don't consider warnings to be a failure in kaya-client --- kaya-client | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kaya-client b/kaya-client index b923403..2c53308 100755 --- a/kaya-client +++ b/kaya-client @@ -54,10 +54,18 @@ cmd=( restic backup "$@") ret=0 "${cmd[@]}" || ret=$? -if (( ret )); then +case $ret in + 0) + # success + ;; + 3) + # restic warning, such as file randomly disappearing during backup + # consider it success + ;; + *) echo "kaya-client: command exit code $ret: ${cmd[*]}" >&2 exit $ret -fi +esac # needed in case ssh dies on the backup server, and exits with 0 (patched in OpenSSH version 8.8) if [[ $kaya_protocol_version -ge 2 ]] ; then echo "KAYA_SUCCESSFUL_BACKUP_MESSAGE" ; fi -- 2.25.1