From 0f425036b22412c6879ce905e77ccc8ccb95a3c3 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Wed, 4 Aug 2021 15:55:14 +0200 Subject: [PATCH] bundles/backup-client: fix newlines --- bundles/backup-client/files/check_backup_last_run | 3 ++- bundles/backup-client/files/generate-backup | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bundles/backup-client/files/check_backup_last_run b/bundles/backup-client/files/check_backup_last_run index 8cc6963..a5e0313 100644 --- a/bundles/backup-client/files/check_backup_last_run +++ b/bundles/backup-client/files/check_backup_last_run @@ -37,5 +37,6 @@ elif exitcode == 'abort_no_key': exit(1) else: # garbage in file - print(' '.join(status)) + for line in status: + print(line) exit(3) diff --git a/bundles/backup-client/files/generate-backup b/bundles/backup-client/files/generate-backup index 5c39909..b1351bf 100644 --- a/bundles/backup-client/files/generate-backup +++ b/bundles/backup-client/files/generate-backup @@ -3,6 +3,8 @@ statusfile=/var/tmp/backup.monitoring ssh_login="${username}@${server}" +NL=$'\n' + if ! [[ -f /etc/backup.priv ]] then echo "abort_no_key" > "$statusfile" @@ -29,7 +31,9 @@ do_backup() { exitcode=$? if [[ $exitcode != 0 ]] && [[ $exitcode != 24 ]] then - rsync_errors+="\n$1 $exitcode" +<%text> + rsync_errors+="${NL}${1} ${exitcode}" + fi }