inotify同步脚本

#!/bin/sh

src=/backup

des=zq

rsync_passwd=/etc/web.passwd

ip=192.168.1.127

user=zq

cd ${src}

/usr/local/inotify-tools/bin/inotifywait -mrq --format '%w%f' -e modify,create,delete,attrib,close_write,move ./ |while read line

do

rsync -avzR --timeout 100 --password-file=${rsync_passwd} $line  ${user}@${ip}::${des} &>/dev/null 

done


你可能感兴趣的:(inotify)