标签:modify function create local
wget https://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
wget https://rsync.samba.org/ftp/rsync/rsync-3.1.1.tar.gz
#!/bin/sh
#date:2015-5-27
#function:rysnc 109.26 to 96.48
log=/tmp/rsync.log
src="/data/"
host="10.139.96.48"
module="/data/backup/data"
/usr/local/bin/inotifywait -mr --timefmt ‘%d/%m/%y %H:%M‘ --format ‘%T %w %f‘ -e close_write,modify,delete,create,attrib $src | while read DATE TIME DIR FILE; do
FILECHANGE=${DIR}${FILE}
#/usr/bin/rsync -avH --delete --progress --password-file=/etc/data.pass $src --exclude-from="/usr/local/inotify/logs/rules.txt" rsyncuser@$host::$module &
#/usr/bin/rsync -avH --delete --progress --password-file=/etc/data.pass $src www@$host::$module &
/usr/bin/rsync -aH --delete -e ‘ssh -p 9902‘ --progress $src zhanglili@$host:$module &
echo "At ${TIME} on ${DATE}, file $FILECHANGE was backed up via rsync" >> $log
done
本文出自 “雨季的问候” 博客,请务必保留此出处http://rain1118.blog.51cto.com/4350097/1655701
标签:modify function create local
原文地址:http://rain1118.blog.51cto.com/4350097/1655701