From: root Date: Wed, 25 Jul 2007 16:47:19 +0000 (+0000) Subject: Now checks wether we actually can SSH to the computer we're backing up first. X-Git-Url: https://git.sesse.net/?p=backup.sh;a=commitdiff_plain;h=ecf023cca4f61a0ed34d42729a930eaa79533525 Now checks wether we actually can SSH to the computer we're backing up first. -berge --- diff --git a/backup.sh b/backup.sh index 7d4ee30..b9bff75 100755 --- 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 ###