From 2d95d80b5fc36b694f672f25ab3ba8f49bbfc713 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 18 Aug 2015 11:14:25 +0200 Subject: [PATCH] backup-script-wrapper: Write a "delimiter line" to the log file --- bin/backup-script-wrapper | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/backup-script-wrapper b/bin/backup-script-wrapper index 62c04b0..047ff96 100755 --- a/bin/backup-script-wrapper +++ b/bin/backup-script-wrapper @@ -24,6 +24,7 @@ NAME="backup-script" HOST=`hostname` TMP=`mktemp /tmp/$NAME.XXXXXXXX` || exit 1 LOGFILE="/var/log/backup-script.log" +DELIMITER="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH @@ -36,7 +37,8 @@ echo " - Host: `hostname -f`" echo " - User: `id -un`" echo -if [ -w "$LOGFILE" ]; then +if echo "$DELIMITER" >>"$LOGFILE" 2>/dev/null; then + echo >>"$LOGFILE" "$(dirname "$0")/backup-script" "$@" | tee -a "$LOGFILE" r=${PIPESTATUS[0]} else -- 2.39.2