Ensure logging succeeds without run log

This commit is contained in:
howard committed 2026-09-25 22:35:20 +12:00
1 parent d73e00db1c
commit 618c196bf0
1 file changed
+4 -1
+4 -1
View File
@@ -50,7 +50,10 @@ log() {
local line local line
line="$(timestamp) [$1] $2" line="$(timestamp) [$1] $2"
printf '%s\n' "$line" >&2 printf '%s\n' "$line" >&2
[[ -n "${BACKUP_RUN_LOG:-}" ]] && printf '%s\n' "$line" >>"$BACKUP_RUN_LOG" if [[ -n "${BACKUP_RUN_LOG:-}" ]]; then
printf '%s\n' "$line" >>"$BACKUP_RUN_LOG"
fi
return 0
} }
die() { log ERROR "$1"; exit "${2:-1}"; } die() { log ERROR "$1"; exit "${2:-1}"; }