
uid = rootgid = rootuse chroot = nomax connections = 5pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.log[www]path=/data/httpd/wwwroot/comment = updateignore errorsread only = nolist = nohosts allow = 192.168.0.0/255.255.255.0auth users = rootuid = rootgid = rootsecrets file = /etc/rsyncd.secrets
#!/bin/bashsrc=/data/httpd/wwwroot/des=wwwhost="192.168.0.6 192.168.0.7 192.168.0.8"/usr/local/bin/inotifywait -mrq --timefmt ‘%d/%m/%y %H:%M‘ --format ‘%T %w%f%e‘ -e close_write,delete,create,attrib $src | while read filesdofor hostip in $hostdorsync -vzrtopg --delete --progress --password-file=/etc/rsyncd.secrets $src root@$hostip::$desdoneecho "${files} was rsynced" >>/tmp/rsync.log 2>&1done
原文:http://www.cnblogs.com/51runsky/p/4572414.html