码迷,mamicode.com
首页 > 其他好文 > 详细

rsync inotify

时间:2014-05-03 01:08:22      阅读:426      评论:0      收藏:0      [点我收藏+]

标签:rsync inotify


rsync客户端+inotify-tools  1.1.1.12

rsync服务器                1.1.1.11


1.1.1.12配置

[root@slave3 wwwroot]# cat /etc/rsyncd-web.sh
#!/bin/bash
host1=1.1.1.11
src=/web/wwwroot/
dst1=web1
/usr/bin/inotifywait -mrq --timefmt ‘%d/%m/%y %H:%M‘ --format ‘%T %w%f%e‘ -e modify,delete,create,attrib $src | while read files
do
    /usr/bin/rsync -vzrtopg --delete --progress --password-file=/etc/server.pass $src $user1@host1::$dst1
 echo "${files} was rsynced" >>/tmp/rsync.log 2>&1
done

认证文件:

[root@slave3 ~]# cat /etc/server.pass
rsync
echo "/usr/bin/rsync --daemon" >>/etc/rc.local
/usr/bin/rsync


1.1.1.11配置



[root@slave2 wwwroot]# cat /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = no
max connections = 10
strict modes = yes
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[web1]
path = /web1/wwwroot/
comment = web1 file
ignore errors
read only = no
write only = no
hosts allow = 1.1.1.12
hosts deny = *
list = false
uid = root
gid = root
auth users = web1user
secrets file = /etc/web1.pass
nohup /etc/rsyncd-web.sh &


[root@slave2 wwwroot]# cat /etc/web1.pass
rsync:rsync    rsync --

rsync inotify,布布扣,bubuko.com

rsync inotify

标签:rsync inotify

原文地址:http://limeizhi.blog.51cto.com/2267772/1405314

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!