Commit a092452c authored by Leo Leung's avatar Leo Leung
Browse files

Check ssh connection before proceeding with backups

parent 02e019d4
......@@ -73,6 +73,17 @@ function backup_volume() {
local OriginSnapshotId=""
local NextSnapshotId="" # when blank, a full transfer will be executed
# Ensure that the remote is available
while ! ssh $SSHAUTH hostname ; do
ConnectionAttempts=$((ConnectionAttempts - 1))
if [ $ConnectionAttempts -le 0 ] ; then
echo "Could not SSH $SSHAUTH. Bailing out."
exit 1
sleep 2
# Get the local snapshot ID (or blank if it does not exist)
# We take the last one (which should be the latest one, if sorted numerically...)
local LocalSnapshotId=$(zfs list -t snapshot $LABEL/$LocalVolumeName \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment