]> arthur.barton.de Git - backup-script.git/commitdiff
backup-script-wrapper: Write a "delimiter line" to the log file
authorAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 09:14:25 +0000 (11:14 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 09:14:25 +0000 (11:14 +0200)
bin/backup-script-wrapper

index 62c04b04a14a06db1d477211467168ea9c0bef3b..047ff96395705c71ea4ebaa71d2e49680f68e7aa 100755 (executable)
@@ -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