From: Steinar H. Gunderson Date: Sat, 4 Oct 2014 20:54:58 +0000 (+0200) Subject: When we run out of disk, do not count that as success. X-Git-Url: https://git.sesse.net/?p=backup.sh;a=commitdiff_plain;h=ce562b239bacaeaded0c54f924c9182af9f8ac4a When we run out of disk, do not count that as success. --- diff --git a/backup.sh b/backup.sh index 366978d..652b463 100755 --- a/backup.sh +++ b/backup.sh @@ -104,8 +104,8 @@ backup() echo `date`" $computer: Running $TARCMD" >&2 eval $TARCMD > $DATE.idx - if [ -s $TARFILE ]; then - # File is >0 in size, we assume it worked. + if [ $? -eq 0 ] && [ -s $TARFILE ]; then + # File is >0 in size and neither cat or tar tzvf failed; we assume it worked. # Move tar file in place mv $TARFILE $DATE.tgz