blob: 0cca9dd748dc14275e096ac8fc36c2319eefc86f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
|