[PC-BSD Commits] r12097 - pcbsd/current/src-qt4/life-preserver/scripts

svn at pcbsd.org svn at pcbsd.org
Thu Aug 11 08:54:37 PDT 2011


Author: kris
Date: 2011-08-11 08:54:36 -0700 (Thu, 11 Aug 2011)
New Revision: 12097

Modified:
   pcbsd/current/src-qt4/life-preserver/scripts/backup-rsync.sh
   pcbsd/current/src-qt4/life-preserver/scripts/list-backup-rsync.sh
   pcbsd/current/src-qt4/life-preserver/scripts/restore-rsync.sh
Log:

Put a check in place to ensure that we can still talk to backup
server before doing a life-preserver backup



Modified: pcbsd/current/src-qt4/life-preserver/scripts/backup-rsync.sh
===================================================================
--- pcbsd/current/src-qt4/life-preserver/scripts/backup-rsync.sh	2011-08-11 15:09:57 UTC (rev 12096)
+++ pcbsd/current/src-qt4/life-preserver/scripts/backup-rsync.sh	2011-08-11 15:54:36 UTC (rev 12097)
@@ -85,6 +85,14 @@
   echo "$$" >${PIDFILE}
 fi
 
+# Make sure we can connect
+ssh ${SSHHOST} -o BatchMode=yes "ls" >/dev/null 2>/dev/null
+if [ $? -ne 0 ]; then
+  echo "Failed to connect! ${STARTDATE}"
+  echo "Failed to connect! ${STARTDATE}" >${RESULTFILE}
+  exit 1
+fi
+
 # Make sure we have the BACKDIR created
 ssh ${SSHHOST} "mkdir -p ${BACKDIR}"
 

Modified: pcbsd/current/src-qt4/life-preserver/scripts/list-backup-rsync.sh
===================================================================
--- pcbsd/current/src-qt4/life-preserver/scripts/list-backup-rsync.sh	2011-08-11 15:09:57 UTC (rev 12096)
+++ pcbsd/current/src-qt4/life-preserver/scripts/list-backup-rsync.sh	2011-08-11 15:54:36 UTC (rev 12097)
@@ -41,6 +41,13 @@
   PORT="22"
 fi
 
+# Make sure we can connect
+ssh -p ${PORT} ${SSHHOST} -o BatchMode=yes "ls" >/dev/null 2>/dev/null
+if [ $? -ne 0 ]; then
+  echo "Failed to connect! ${STARTDATE}"
+  exit 1
+fi
+
 # Get a listing of the number of full backups saved
 OLDBACKUPS=`ssh -p ${PORT} ${SSHHOST} "ls -dt ${BACKDIR}/back-*"`
 if [ "$?" = "0" ]

Modified: pcbsd/current/src-qt4/life-preserver/scripts/restore-rsync.sh
===================================================================
--- pcbsd/current/src-qt4/life-preserver/scripts/restore-rsync.sh	2011-08-11 15:09:57 UTC (rev 12096)
+++ pcbsd/current/src-qt4/life-preserver/scripts/restore-rsync.sh	2011-08-11 15:54:36 UTC (rev 12097)
@@ -48,6 +48,12 @@
   PORT="22"
 fi
 
+# Make sure we can connect
+ssh -p ${PORT} ${SSHHOST} -o BatchMode=yes "ls" >/dev/null 2>/dev/null
+if [ $? -ne 0 ]; then
+  echo "Failed to connect! ${STARTDATE}"
+  exit 1
+fi
 
 # Create our restore list which will we suck back in 
 TMPRESTOREFILE="/tmp/.restoreList.$$"



More information about the Commits mailing list