时间:2015-01-04 15:45:53 作者:qipeng 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20150104/33943.html 手机查看 评论 反馈
代码如下:
《?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=“/home/www.jb51.com”》
《remote ip=“192.168.21.127” name=“home_www.jb51.net”/》
《remote ip=“192.168.21.128” name=“home_www.jb51.net”/》
《!--《remote ip=“192.168.8.40” name=“tongbu”/》--》
《/localpath》
《rsync》
《commonParams params=“-artuz”/》
《auth start=“true” users=“home_www.jb51.net_user” 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=“true” schedule=“600”》《!--600mins--》
《crontabfilter start=“false”》
《exclude expression=“*.php”》《/exclude》
《exclude expression=“info/*”》《/exclude》
《/crontabfilter》
《/crontab》
《plugin start=“false” name=“command”/》
《/sersync》
《plugin name=“command”》
《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 name=“socket”》
《localpath watch=“/opt/tongbu”》
《deshost ip=“192.168.138.20” port=“8009”/》
《/localpath》
《/plugin》
《plugin name=“refreshCDN”》
《localpath watch=“/data0/htdocs/cms.xoyo.com/site/”》
《cdninfo domainname=“ccms.chinacache.com” port=“80” username=“xxxx” passwd=“xxxx”/》
《sendurl base=“《a href=”https://pic.xoyo.com/cms“/”》https://pic.xoyo.com/cms“/《/a》》
《regexurl regex=”false“ match=”cms.xoyo.com/site([/a-zA-Z0-9]*).xoyo.com/images“/》
《/localpath》
《/plugin》
《/head》
:wq! #保存退出
参数说明:
代码如下:
localpath watch=”/home/www.jb51.net“:#源服务器同步目录
192.168.21.127,192.168.21.128:#目标服务器IP地址
name=”home_www.jb51.net“: #目标服务器rsync同步目录模块名称
users=”home_www.jb51.net_user“: #目标服务器rsync同步用户名
passwordfile=”/etc/passwd.txt“: #目标服务器rsync同步用户的密码在源服务器的存放路径
remote ip=”192.168.21.127“: #目标服务器ip,每行一个
remote ip=”192.168.21.128“: #目标服务器ip,每行一个
failLog path=”/tmp/rsync_fail_log.sh“ #脚本运行失败日志记录
start=”true“ #设置为true,每隔600分钟执行一次全盘同步
5、设置sersync监控开机自动执行
vi /etc/rc.d/rc.local #编辑,在最后添加一行
代码如下:
/usr/local/sersync/sersync2 -d -r -o /usr/local/sersync/confxml.xml #设置开机自动运行脚本
:wq! #保存退出
发表评论
共0条
评论就这些咯,让大家也知道你的独特见解
立即评论以上留言仅代表用户个人观点,不代表系统之家立场