]> git.sesse.net Git - backup.sh/commitdiff
Now checks wether we actually can SSH to the computer we're backing up first.
authorroot <empty>
Wed, 25 Jul 2007 16:47:19 +0000 (16:47 +0000)
committerroot <empty>
Wed, 25 Jul 2007 16:47:19 +0000 (16:47 +0000)
-berge

backup.sh

index 7d4ee304118f5c95a509b618fa4d03bda8a7c55c..b9bff7541cc7fd77ceaaad214459b8940862df2b 100755 (executable)
--- a/backup.sh
+++ b/backup.sh
@@ -116,6 +116,15 @@ backup()
 for computer in $unixcomputers
 do
 ( 
+
+ # Try to SSH to the computer without entering a password.
+ if `ssh -n -o NumberOfPasswordPrompts=0 $computer /bin/true`; then
+  echo "Passwordless SSH to $computer works."
+ else
+  echo "Could not use passwordless SSH to $computer. Exiting."
+  exit 1;
+ fi
  #tømmer variabelen for sikkerhets skyld
  filesystems=""
 
@@ -213,7 +222,8 @@ done &
 wait
 
 #create report
-/home/backup/report.sh $storagedir > /tmp/report.txt
+# (Hasn't been working for years -berge)
+#/home/backup/report.sh $storagedir > /tmp/report.txt
 #[ ! -z $remotestat ] && scp /tmp/report.txt $remotestat
 ###