]> git.sesse.net Git - backup.sh/commitdiff
Some minor cleanups.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 4 Oct 2014 22:24:25 +0000 (00:24 +0200)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 4 Oct 2014 22:28:03 +0000 (00:28 +0200)
backup.sh

index e7c04c0f9b06183156dbf798fc8638278b80e7a4..22f4e97a679f33d9b6efffe4e504d8ab3d259815 100755 (executable)
--- a/backup.sh
+++ b/backup.sh
@@ -147,8 +147,6 @@ backup()
   # Something wrong happened.
   rm $TARFILE
   echo `date`" $computer: $TARFILE empty. $backuplevel backup of $computer:$filesystem failed and deleted"
-
-  # We don't want to return 0
   die
  fi
 
@@ -172,8 +170,6 @@ backup()
  # Try to SSH to the computer without entering a password.
  if ! `ssh -n -o NumberOfPasswordPrompts=0 root@$computer /bin/true`; then
   echo `date`" $computer: Could not use passwordless SSH."
-
-  # We don't want to return 0
   die
  fi
 
@@ -185,8 +181,6 @@ backup()
    compressor=gzip
  fi
  
- filesystems=""
-
  # Check dump bit in fstab
  filesystems=`ssh -n root@$computer "cat /etc/fstab" \
   | grep -v nfs \
@@ -196,33 +190,33 @@ backup()
 
  # Clean up our dir at this client
  if ! ssh root@$computer "rm -r ~/.backup ; mkdir -m 700 ~/.backup"; then
-  echo `date`" $computer: Could not create backup staging area at $computer:~/.backup - skipping backup of $computer"
+  echo `date`" $computer: Could not create backup staging area at $computer:~/.backup"
   die
  fi
 
  # Try to copy $exclude to $computer
  if ! scp $exclude root@$computer:~/.backup/exclude > /dev/null; then
-  echo `date`" $computer: Could not copy exclude.txt to $computer - skipping backup of $computer"
+  echo `date`" $computer: Could not copy exclude.txt to $computer"
   die
  fi
 
  # Try to copy preeexec and postexec if they exist
  if [ -f $confdir/preexec.$computer ]; then
    if ! scp $confdir/preexec.$computer  root@$computer:~/.backup/preexec >&2; then
-     echo `date`" $computer: Could not copy preexec.$computer to $computer:~/.backup/preexec - skipping backup of $computer"
+     echo `date`" $computer: Could not copy preexec.$computer to $computer:~/.backup/preexec"
      die
    fi
  fi
  if [ -f $confdir/postexec.$computer ]; then
    if ! scp $confdir/postexec.$computer root@$computer:~/.backup/postexec >&2; then
-     echo `date`" $computer: Could not copy postexec.$computer to $computer:~/.backup/postexec - skipping backup of $computer"
+     echo `date`" $computer: Could not copy postexec.$computer to $computer:~/.backup/postexec"
      die
    fi
  fi
 
  # Try to run preexec if it exist
  if ! ssh root@$computer "[ ! -f ~/.backup/preexec ] || /bin/bash -x ~/.backup/preexec" >&2; then
-       echo `date`" $computer: Could not run $computer:~/.backup/preexec - skipping backup of $computer"
+       echo `date`" $computer: Could not run $computer:~/.backup/preexec"
        die
  fi
 
@@ -248,8 +242,7 @@ backup()
    echo $DATEs > $storagedir/$computer/$sfilesystem/.date
   fi
 
-  # Check if we want a full backup - Debug statement that causes noise in cron mail:
-  # printf " $computer $filesystem: $confdir/fastfullbackupdag.$computer.$sfilesystem\n"
+  # Check if we want a full backup
   if [ -f $confdir/fastfullbackupdag.$computer.$sfilesystem ]; then
     fullbackup_min_for_this_machine=$dagermellomfulleforfast
     if [ "$DAY_OF_MONTH" = "`cat $confdir/fastfullbackupdag.$computer.$sfilesystem`" ]; then