Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/etc:/usr/local/bin:/usr/local/sbin
- set -x
- dir_log="/var/log/rsync/"
- file_log="${dir_log}rsync-config-OVH-storage.log"
- speed_limit=90000 # in KB/s
- [ ! -d ${dir_log} ] && { mkdir -p ${dir_log}; }
- cd /root/script/rsync
- while [ 1 ]
- do
- /usr/local/bin/flock -xno -E 1 /var/run/backup-config-OVH-storage.lock \
- /usr/local/bin/sshpass -f ovh_storage.pass \
- rsync -ravu -L --bwlimit=${speed_limit} \
- --log-file=${file_log} \
- /backup/config-rsync/ [email protected]:server-config/cdn.XXXXX/config
- if [ "$?" = "0" ] ; then
- echo "rsync completed normally" | tee -a ${file_log}
- exit 1
- else
- echo "Rsync failure. Backing off and retrying..." | tee -a ${file_log}
- sleep 30
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement