1客户端 192.168.0.153 服务端 115.182.10.144
客户端操作
sersync 下载地址
tar -zxvf sersync2.5.4_64bit_binary_stable_final.tar.gz -C /usr/bin
cd /usr/bin/GNU-Linux-x86/
[root@wlmachine GNU-Linux-x86]# ls
confxml.xml sersync2
有这两个文件是对的
vim confxml.xml
[root@wlmachine GNU-Linux-x86]# vim confxml.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">
<host hostip="localhost" port="8008"></host>
<debug start="false"/>
<fileSystem xfs="false"/>
<filter start="false">
<exclude expression="(.*)\.svn"></exclude>
<exclude expression="(.*)\.gz"></exclude>
<exclude expression="^info/*"></exclude>
<exclude expression="^static/*"></exclude>
</filter>
<inotify>
<delete start="true"/>
<createFolder start="true"/>
<createFile start="false"/>
<closeWrite start="true"/>
<moveFrom start="true"/>
<moveTo start="true"/>
<attrib start="false"/>
<modify start="false"/>
</inotify>
<sersync>
<localpath watch="/opt/test">
<remote ip="192.168.1.55"/>
<!--<remote ip="192.168.8.39"/>-->
<!--<remote ip="192.168.8.40"/>-->
</localpath>
<rsync>
<commonParams params="-artuz"/>
<auth start="false" users="root" passwordfile="/etc/rsync.pas"/>
<userDefinedPort start="false" port="874"/><!-- port=874 -->
<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"/>
</sersync>
<plugin>
<param prefix="/bin/sh" suffix="" ignoreError="true"/> <!--prefix /opt/tongbu/mmm.sh suffix-->
<filter start="false">
<include expression="(.*)\.php"/>
<include expression="(.*)\.sh"/>
</filter>
</plugin>
<plugin>
<localpath watch="/opt/tongbu">
加粗部分是更改的部分
更改共享目录
保存退出
sersync+rsync 实时同步
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/0a378e6d5358199bc2be3312b2b3fffd.html