]> git.sesse.net Git - backup.sh/blobdiff - backup.sh
When we run out of disk, do not count that as success.
[backup.sh] / backup.sh
index bafb1e32997151728cd0289d0c86b452fa37b7d2..652b4636b36b8406a2631b0f2c5f5d234b0a0232 100755 (executable)
--- a/backup.sh
+++ b/backup.sh
 # 
 # The script is halfway Norwegian and halfway English. Newer modifications are
 # in English, we should probably stick to that.
-# 
-# Known issues:
-#
-# o $R has no proper meaning because of the forking subshell stuff. We need a
-#   more robust way of returning non-zero on errors, which we probably don't
-#   right now.
-#
 
 # The computer to backup.
 computer=$1
@@ -111,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