Sersync2 xml配置文件解析

最近经常使用sersync2,记录一下xml配置文件的的详细解释:

<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">

    <!-- 插件使用,对同步功能没有作业 -->
    <host hostip="localhost" port="8008"></host>

    <!-- debug模式-->
    <debug start="false"/>

    <!-- xfs文件系统需要打开此参数 -->
    <fileSystem xfs="false"/>

    <!-- 自定义过滤文件规则 -->
    <filter start="false">
	<exclude expression="(.*)\.svn"></exclude>
	<exclude expression="(.*)\.gz"></exclude>
	<exclude expression="^info/*"></exclude>
	<exclude expression="^static/*"></exclude>
    </filter>

    <!-- inotify参数优化设置 -->
    <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/spider_data">
	    <!-- 远程rsync模块信息,可以配置多个 -->
	    <remote ip="114.80.13.39" name="spider"/>
	    <!--<remote ip="192.168.8.39" name="tongbu"/>-->
	</localpath>

	<!-- rsync参数设置 -->
	<rsync>
	    <commonParams params="-artuz"/>
	    <!-- 是否开启rsync同步认证模式 -->
	    <auth start="true" users="root" passwordfile="/etc/rsync.pas"/>
 	    <!-- 设置远程rsync的端口是否是默认端口 -->
	    <userDefinedPort start="false" port="874"/>
	    <!-- 设置rsync的timeout时间 -->
	    <timeout start="true" time="300"/>
	    <!-- rsync是否使用rsync -e ssh方式传输 -->
	    <ssh start="false"/>
	</rsync>

	<!-- 传输失败文件的记录日志,每隔60min会进行再次传输 -->
	<failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/>

	<!-- 除了实时同步外,还可以定时进行整体同步,防止有文件遗漏,默认600min分支一次 -->
	<crontab start="true" schedule="600">
	    <!-- 是否开启整体同步过滤机制 -->
	    <crontabfilter start="false">
		<exclude expression="*.php"></exclude>
		<exclude expression="info/*"></exclude>
	    </crontabfilter>
	</crontab>
	<plugin start="false" name="command"/>
    </sersync>


    <!-- 插件是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="http://pic.xoyo.com/cms"/>
	    <regexurl regex="false" match="cms.xoyo.com/site([/a-zA-Z0-9]*).xoyo.com/images"/>
	</localpath>
    </plugin>
    -->

</head>

 

转载于:https://my.oschina.net/guol/blog/690241

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值