summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backup.conf5
-rwxr-xr-xbackup.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/backup.conf b/backup.conf
index 63e3ec5..fd2822e 100644
--- a/backup.conf
+++ b/backup.conf
@@ -40,3 +40,8 @@ cacheDir="/path/to/cache/directory"
# timeout for `du` in backup-progress [seconds]
du_timeout=10
+
+# hook to execute before connecting via ssh or rsync
+preConnectHook() {
+ :
+}
diff --git a/backup.in b/backup.in
index e499f02..2c73947 100755
--- a/backup.in
+++ b/backup.in
@@ -192,6 +192,7 @@ fi
echo $$ > "${pidFile}"
if [ -n "${tunnelBefehl}" ]; then
+ preConnectHook
${tunnelBefehl} &
backgroundPid=$!
sleep 4
@@ -207,19 +208,23 @@ fi
chmod 750 "${neues}"{,/wip}
chown root:root "${neues}"{,/wip}
if [ -z "${rsyncShell}" ]; then
+ preConnectHook
rsync ${rsyncOptions} \
${linkdests} \
${excludeArgs} \
${Quelle} "${neues}/wip/"
sleep 1
+ preConnectHook
rsync ${Quelle}
else
+ preConnectHook
rsync "${rsyncShell}" \
${rsyncOptions} \
${linkdests} \
${excludeArgs} \
${Quelle} "${neues}/wip/"
sleep 1
+ preConnectHook
rsync "${rsyncShell}" ${Quelle}
fi
erg=$?