inotify+rsync+mutt+msmtp实现linux文件或者目录自动更新
---使用xinetd管理rsync程序---- yum -y install xinetd vi /etc/xinetd.d/rsync service rsync { disable = no 服务器IP:192.168.0.110 vi /etc/sysctl.conf 内核参数修改 fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 1024 fs.inotify.max_user_watches = 1048576 sysctl -p 初始化内核参数 首先安装包 #!/bin/bash yum install rsync -y mkdir -p 更新目录地址,可以根据实际需要添加目录 wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz tar xzvf inotify-tools-3.14.tar.gz cd inotify-tools-3.14 ./configure make make install cat >>/home/rsync.sh <<EOF vi 1.sh #!/bin/bash rsync -vzrtopg --delete --progress 更新目录地址 www1@192.168.0.185::static --password-file=/etc/www1.pwd 发现很多报错 2013/09/17 12:03:02 [8351] rsync: failed to set times on "views/main" (in static): Operation not permitted (1) 2013/09/17 12:03:02 [8351] rsync: failed to set times on "views/website" (in static): Operation not permitted (1) 2013/09/17 12:03:02 [8351] rsync: failed to set times on "views/website/xy" (in static): Operation not permitted 这个问题是由于权限的问题,chown nobody.nobody (1)修改前,rsync 推送文件到目标服务器出错 : 查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/ (编辑:佛山站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |