From 33f125a7e802534c2ae8aeb01ac3f55fcf81bd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 2 Jun 2024 23:58:24 +0200 Subject: [PATCH] Change backup command --- backup.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup.nix b/backup.nix index be2102e..e56c9a2 100644 --- a/backup.nix +++ b/backup.nix @@ -15,11 +15,11 @@ let exit_code=0; for i in ''${BACKUP_HELPER_DIRS//,/ }; do echo "Starting backup of $i"; - output=$(restic backup "$i" && rc=$? || rc=$?); - if [ $rc -ne 0 ]; then + output=$(restic backup "$i"); + if [ "$?" -ne 0 ]; then + exit_code="$?"; echo "Backup of $i failed with exit code $rc:" echo "$output" - exit_code="$rc"; else echo "Backup of $i successful:" echo "$output"