From f05fae6ebd7702789c99f5986d304dc627afe558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 3 Jun 2024 00:01:36 +0200 Subject: [PATCH] Fix sc2181 --- backup.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backup.nix b/backup.nix index bd5cc21..9909f46 100644 --- a/backup.nix +++ b/backup.nix @@ -14,8 +14,7 @@ let exit_code=0; for i in ''${BACKUP_HELPER_DIRS//,/ }; do echo "Starting backup of $i"; - output=$(restic backup "$i"); - if [ "$?" -ne 0 ]; then + if ! output=$(restic backup "$i"); then exit_code="$?"; echo "Backup of $i failed with exit code $?:" echo "$output"