sersync---confxml.xml配置文件詳解



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

<head version="2.5">

    <!--本地主機地址-->

    <host hostip="10.2.22.27" port="8008"></host>

    <!--是否打開調試信息-->

    <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>

        <delete start="true"/>

        <createFolder start="true"/>

        <createFile start="false"/>

        <closeWrite start="true"/>

        <moveFrom start="true"/>

        <moveTo start="true"/>

        <attrib start="true"/>

        <modify start="true"/>

    </inotify>

 

    <sersync>

        <!--本地需要監視的目錄-->

        <localpath watch="/data/sersync/">

            <!--目的段IP地址和rsync同步子項的服務名-->

            <remote ip="10.2.22.27" name="sersync_test"/>

            <!--理論上如果有多個目的端,可在此逐個列出,最好啓用新實例,每個實例配置一個地址和服務名-->

            <!--<remote ip="192.168.8.39" name="tongbu"/>-->

            <!--<remote ip="192.168.8.40" name="tongbu"/>-->

        </localpath>

        <rsync>

            <!--sersync調用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>

        <!--指定如果同步失敗,記錄到哪個文件,以便在60分鐘後嘗試重傳-->

        <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>

 

    <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/p_w_picpaths"/>

        </localpath>

    </plugin>

</head>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章