]> git.sesse.net Git - backup.sh/commitdiff
When we run out of disk, do not count that as success.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 4 Oct 2014 20:54:58 +0000 (22:54 +0200)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 4 Oct 2014 20:56:31 +0000 (22:56 +0200)
backup.sh

index 366978dd0bfebe73a9021eeecb607af8631fc7a1..652b4636b36b8406a2631b0f2c5f5d234b0a0232 100755 (executable)
--- 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