...
分类: LINUX
2012-02-15 16:18:06
【Linux下rsync+inotify实时脚本】
#!/bin/sh
src=/home/webapps/www
des=/home/webapps/
ip=192.168.2.100
inotifywait -mrq –timefmt ‘%d/%m/%y-%H:%M’ –format ‘%T %w%f’ -e modify,delete,create,attrib ${src} | while read file
do
for i in $ip
do
/usr/local/rsync/bin/rsync -aP –delete $src root@$ip:$des
done
done