From 93f0ec2f1a7847f65ce413a3d0aa0f0e995e7c44 Mon Sep 17 00:00:00 2001
From: Peter Thurner | Blunix GmbH
Date: Fri, 8 Sep 2023 21:33:05 +0200
Subject: [PATCH] ignore exit code 1 (changed files)
https://github.com/borgbackup/borg/issues/6622
---
templates/usr/local/sbin/borgbackup-create.sh.j2 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/templates/usr/local/sbin/borgbackup-create.sh.j2 b/templates/usr/local/sbin/borgbackup-create.sh.j2
index 9fc264e..8e8401b 100644
--- a/templates/usr/local/sbin/borgbackup-create.sh.j2
+++ b/templates/usr/local/sbin/borgbackup-create.sh.j2
@@ -67,12 +67,12 @@ echo -e "\n\nBACKUP END $(date +%d_%m_%y-%H_%M_%S)\n\n" >> $logfile
echo borg_backup_exit_status $borg_backup_exit_status > /var/lib/prometheus-node-textfile-collector/logs/borg_backup_exit_status.prom
-if [[ "$borg_backup_exit_status" == "0" ]]; then
+# https://github.com/borgbackup/borg/issues/6622
+if [[ "$borg_backup_exit_status" == "0" ]] || [[ "$borg_backup_exit_status" == "1" ]]; then
echo borg_last_successful_backup $(date "+%s") > /var/lib/prometheus-node-textfile-collector/logs/borg_backup.prom
-fi
# send message to monitoring if there is a problem
-if [[ "$borg_backup_exit_status" != "0" ]] || [[ "$borg_hook_general_exit_status" != "0" ]]; then
+elif [[ "$borg_backup_exit_status" != "0" ]] && [[ "$borg_backup_exit_status" != "1" ]] || [[ "$borg_hook_general_exit_status" != "0" ]]; then
echo "Error running borg backup!"
echo "borg_backup_exit_status $borg_backup_exit_status"
echo "borg_hook_general_exit_status $borg_hook_general_exit_status"