From 2fddd57ed838e25d22dc972c94114f80f09153d8 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 7 Jul 2024 10:23:20 +0200 Subject: [PATCH] bundles/backup-client: only log to logfile when not running in debug mode --- bundles/backup-client/files/generate-backup | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bundles/backup-client/files/generate-backup b/bundles/backup-client/files/generate-backup index 28ef49d..3fd9d7d 100644 --- a/bundles/backup-client/files/generate-backup +++ b/bundles/backup-client/files/generate-backup @@ -62,10 +62,13 @@ trap "on_exit" EXIT # redirect stdout and stderr to logfile prepare_and_cleanup_logdir -logfile="$logdir/backup--$(date '+%F--%H-%M-%S')--$$.log.gz" -echo "All log output will go to $logfile" | logger -it backup-client -exec > >(gzip >"$logfile") -exec 2>&1 +if [[ -z "$DEBUG" ]] +then + logfile="$logdir/backup--$(date '+%F--%H-%M-%S')--$$.log.gz" + echo "All log output will go to $logfile" | logger -it backup-client + exec > >(gzip >"$logfile") + exec 2>&1 +fi # this is where the real work starts ts_begin=$(date +%s)