Ensure logging succeeds without run log
This commit is contained in:
1 parent
d73e00db1c
commit
618c196bf0
1 file changed
+4
-1
+4
-1
@@ -50,7 +50,10 @@ log() {
|
||||
local line
|
||||
line="$(timestamp) [$1] $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}"; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user