X-Git-Url: https://git.sesse.net/?p=backup.sh;a=blobdiff_plain;f=backup.sh;fp=backup.sh;h=55bad7caf4826e21a5787b0611763848afa84e01;hp=c79432293d3aff1c8ff392bac8c2581d42193fae;hb=6c060c67fe39a3bc00be689b44f77c70a584e3cc;hpb=1cf6fdfd22c1250045695f5723e84c0d7d0c84bd diff --git a/backup.sh b/backup.sh index c794322..55bad7c 100755 --- a/backup.sh +++ b/backup.sh @@ -153,13 +153,15 @@ backup() # - No .idx files. # - No .snar-style incremental backups, only date-based. # - No touching of .lastbackup for Nagios. +# - Failed tar operations may go undetected, since we only see the error code +# the last process in the pipe chain, which is gpg. nonprivbackup() { infomsg "$computer:$filesystem $backuplevel non-privileged backup" if [ "$backuplevel" = "daglig" ]; then lastd=`cat ../.date` - lastcmd="\"$lastd\"" + lastcmd="'$lastd'" else lastcmd="" fi @@ -169,8 +171,8 @@ nonprivbackup() infomsg "Running $TARCMD" eval $TARCMD > $TARFILE - if [ $? -lt 2 ] && [ -s $TARFILE ]; then - # File is >0 in size and the remote tar did not report any fatal errors; we assume it worked. + if [ $? -eq 0 ] && [ -s $TARFILE ]; then + # File is >0 in size and the remote side did not report any fatal errors; we assume it worked. # Move tar file in place mv $TARFILE $DATE.tgz.gpg