设为首页 加入收藏

TOP

Sersync+Rsync实现触发式文件同步(二)
2017-10-13 10:36:46 】 浏览:9359
Tags:Sersync Rsync 实现 发式 文件 同步
,一旦本地目录有文件变化,将同步到服务端
<remote ip="172.16.57.26" name="recv"/>#服务端ip和同步模块 </localpath> <rsync> <commonParams params="-artuz"/> #rsync同步参数 <auth start="true" users="rsync" passwordfile="/etc/rsync.pas"/> #服务端认证密码 <userDefinedPort start="false" port="873"/> <timeout start="false" time="100"/><!-- timeout=100 --> <ssh start="false"/> </rsync> <failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once--> <crontab start="false" schedule="600"><!--600mins--> <crontabfilter start="false"> <exclude expression="*.php"></exclude> <exclude expression="info/*"></exclude> </crontabfilter> </crontab> <plugin start="false" name="command"/> </sersync> </head>

4、服务端密码认证

# vim /etc/rsync.pas #在相应的目录下配置身份验证文件,里面输入服务端的密码,并chmod 600
# chmod 600 /etc/rsync.pas

5、启动sersync

# ./sersync2 -d -o confxml.xml

四、测试认证

在客户端下监控目录/opt/rsync_data/send下添加文件或者删除,服务端的接受目录都会实时地进行更新。

在此例中,服务器iptables和selinux均处于关闭状态。

note: 这种方法同步文件的时候,同步文件的数量如果很多,可能会有部分文件在同步过程中缺失。查阅相关资料后,找到了如下的解决方案。由于本例中,使用的是xinetd方式启动的rsync服务,在xinetd的配置文件中,修改几个参数如下:

# vim /etc/xinetd.conf
修改几个参数:
 cps             = 500 30
 instances       = UNLIMITED
 per_source      = UNLIMITED
首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Linux 安装与配置 mysql 环境 下一篇Linux shell ftp命令下载文件 根..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目