From ecf023cca4f61a0ed34d42729a930eaa79533525 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Jul 2007 16:47:19 +0000 Subject: [PATCH] Now checks wether we actually can SSH to the computer we're backing up first. -berge --- backup.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 ### -- 2.39.2