X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=bin%2Fbackup-script-wrapper;h=62c04b04a14a06db1d477211467168ea9c0bef3b;hb=28db532889a6e5ce57ec9d32bef793c6a621a41c;hp=7da3208657c056b51f6abf27bf7670e6e952d55a;hpb=1f9e53a47b46b88f37119068d55dfb85f2341e37;p=backup-script.git diff --git a/bin/backup-script-wrapper b/bin/backup-script-wrapper index 7da3208..62c04b0 100755 --- a/bin/backup-script-wrapper +++ b/bin/backup-script-wrapper @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # backup-script system for cloning systems using rsync # Copyright (c)2008-2015 Alexander Barton, alex@barton.de @@ -22,7 +22,7 @@ fi NAME="backup-script" HOST=`hostname` -TMP=`mktemp /tmp/$NAME.XXXXXXXX` || exit 11 +TMP=`mktemp /tmp/$NAME.XXXXXXXX` || exit 1 LOGFILE="/var/log/backup-script.log" PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" @@ -38,13 +38,16 @@ echo if [ -w "$LOGFILE" ]; then "$(dirname "$0")/backup-script" "$@" | tee -a "$LOGFILE" + r=${PIPESTATUS[0]} else "$(dirname "$0")/backup-script" "$@" + r=$? echo "(Can't write logfile: \"$LOGFILE\"!)" fi cat "$TMP" | mail -s "$HOST: $NAME results" "$MAILTO" rm -f "$TMP" +exit $r # -eof-