summaryrefslogtreecommitdiff
path: root/tmp/birdtransporter.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tmp/birdtransporter.sh')
-rw-r--r--tmp/birdtransporter.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tmp/birdtransporter.sh b/tmp/birdtransporter.sh
new file mode 100644
index 0000000..0cca9dd
--- /dev/null
+++ b/tmp/birdtransporter.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+while :
+do
+ rsync --remove-source-files -rltgoDv -e 'ssh -p ${SSH_PORT} -i ${SSH_PRIV_KEY_PATH}' ${LOCAL_SOURCE_FOLDER_PATH} ${SSH_REMOTE_USER}@${FILESERVER_IP}:${REMOTE_TARGET_FOLDER_PATH}
+ if [ $(ls -l ${LOCAL_SOURCE_FOLDER_PATH} | wc -l) -gt 1 ]
+ then
+ continue
+ fi
+ inotifywait -e create ${LOCAL_SOURCE_FOLDER_PATH}
+ echo "change detected"
+ sleep 2
+done
+