Call error code variable ERRSTAT, that is what it is called within the code and also...
authorSven Hoexter <sven@stormbind.net>
Sun, 21 Apr 2013 13:56:09 +0000 (15:56 +0200)
committerSven Hoexter <sven@stormbind.net>
Sun, 21 Apr 2013 13:56:09 +0000 (15:56 +0200)
hetzner/hetznerbackupv2.sh

index 0ffc0ec..d934a02 100755 (executable)
@@ -68,8 +68,8 @@ cleanup() {
     if [ $ERRSTAT -eq 0 ]; then
        echo "Backup finished successfully $ENDDATE" >> $SESSIONLOG
     else
-       echo "ERROR Backup FAILED $ENDDATE" >> $SESSIONLOG
-       cat $SESSIONLOG|mail -s "ERROR Backup FAILED $ENDDATE with ERRCODE $ERRSTAT" $ROOTMAIL
+       echo "ERROR Backup FAILED $ENDDATE with ERRSTAT $ERRSTAT" >> $SESSIONLOG
+       cat $SESSIONLOG|mail -s "ERROR Backup FAILED $ENDDATE with ERRSTAT $ERRSTAT" $ROOTMAIL
     fi
    cat $SESSIONLOG >> $LOGFILE
    rm $SESSIONLOG $LOCKFILE