From ae23a0492506308257246af6fabda8ac7b0f6b47 Mon Sep 17 00:00:00 2001 From: John Lawless Date: Mon, 18 May 2009 22:22:15 -0700 Subject: [PATCH] First, I added the following before any old backup gets deleted: > # Verify source is up and accepting connections before deleting any old backups > rsync "$source" >/dev/null || _exit_err "Source ${source} is not readable. Skipping." I think that this quick test is a much better than, say, pinging the source in a pre-exec script: this tests not only that the source is up and connected to the net, it also verifies (1) that ssh is up and accepting our key (if we are using ssh), and (2) that the source directory is mounted (if it needs to be mounted) and readable. --- ccollect.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ccollect.sh b/ccollect.sh index e14dcfc..0444ff0 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -366,6 +366,8 @@ while [ "${i}" -lt "${no_sources}" ]; do _exit_err "Source ${c_source} is not readable. Skipping." fi fi + # Verify source is up and accepting connections before deleting any old backups + rsync "$source" >/dev/null || _exit_err "Source ${source} is not readable. Skipping." # # Destination is a path