X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=bin%2Fbackup-script-wrapper;h=8d160e494ee09705725589401f06b7a042bb19e5;hb=d1fa151025d6284c557f1e92bfb94a6f94f225f1;hp=482609fa0ea65b6b58722818ccb063c6eb0810d1;hpb=e6ed39f7f7103e43e4560e036e42182a2857c86c;p=backup-script.git diff --git a/bin/backup-script-wrapper b/bin/backup-script-wrapper index 482609f..8d160e4 100755 --- a/bin/backup-script-wrapper +++ b/bin/backup-script-wrapper @@ -25,6 +25,7 @@ HOST=`hostname -f` TMP=`mktemp /tmp/$NAME.XXXXXXXX` || exit 1 LOGFILE="/var/log/backup-script.log" DELIMITER="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" +SUBJECT="$NAME results" PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH @@ -47,7 +48,14 @@ else echo "(Can't write logfile: \"$LOGFILE\"!)" fi -cat "$TMP" | mail -s "$HOST: $NAME results" "$MAILTO" +case "$r" in + 0) + ;; + *) + SUBJECT="$SUBJECT - with ERRORS!" +esac + +cat "$TMP" | mail -s "$HOST: $SUBJECT" "$MAILTO" rm -f "$TMP" exit $r