check borg return codes
This commit is contained in:
parent
33416f8144
commit
78bdc0e5d6
@ -540,6 +540,26 @@ fi
|
|||||||
|
|
||||||
# execute borg
|
# execute borg
|
||||||
${borgCMD} 2>> "$logFile"
|
${borgCMD} 2>> "$logFile"
|
||||||
|
borgResult="$?"
|
||||||
|
|
||||||
|
## check borg exit status
|
||||||
|
if [ "$borgResult" -eq 0 ]; then
|
||||||
|
printf "${ok}[%s] -- [SUCCESS] Borg backup completed " \
|
||||||
|
"$(stamp)" >> "$logFile"
|
||||||
|
printf "successfully --${norm}\n" >> "$logFile"
|
||||||
|
elif [ "$borgResult" -eq 1 ]; then
|
||||||
|
printf "${warn}[%s] -- [WARNING] Borg completed with warnings. " \
|
||||||
|
"$(stamp)" >> "$logFile"
|
||||||
|
printf "Review this logfile for details --${norm}\n" >> "$logFile"
|
||||||
|
elif [ "$borgResult" -ge 2 ]; then
|
||||||
|
exitError 139 "Borg exited with a critical error. \
|
||||||
|
Review this log for details"
|
||||||
|
else
|
||||||
|
printf "${warn}[%s] -- [WARNING] Borg exited with uknown return code. " \
|
||||||
|
"$(stamp)" >> "$logFile"
|
||||||
|
printf "Review this logfile for details --${norm}\n" >> "$logFile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user