加入收藏 | 设为首页 | 会员中心 | 我要投稿 佛山站长网 (https://www.0757zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Centos 6.3下rsync+sersync安装配置笔记

发布时间:2016-11-01 02:51:49 所属栏目:Linux 来源:网络整理
导读:最近单位活比较多,所以就很少更新,晚上上网碰巧看到一篇关于sersync的介绍,个人感觉较rsync+inotify配置更加规范,刚好最近手痒,就总结了下,分享给大家。

# rsync指令参数

     <commonParams params="-auvzP" />

# rsync同步认证

     <auth start="true" users="user" passwordfile="/etc/rsync.pas" />

# 设置rsync远程服务端口,远程非默认端口则需打开自定义

     <userDefinedPort start="false" port="874" /><!-- port=874 -->

查看本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/

# 设置超时时间

     <timeout start="true" time="100" /><!-- timeout=100 -->

# 设置rsync+ssh加密传输模式,默认关闭,开启需设置SSH加密证书

     <ssh start="false" />

 </rsync>

# sersync传输失败日志脚本路径,每隔60会重新执行该脚本,执行完毕会自动清空。

 <failLog path="/usr/local/sersync/log/rsync_fail_log.sh" timeToExecute="60" /><!--default every 60mins execute once-->

# 设置rsync+crontab定时传输,默认关闭

 <crontab start="false" schedule="600"><!--600mins-->

     <crontabfilter start="false">

         <exclude expression="*.php"></exclude>

         <exclude expression="info/*"></exclude>

     </crontabfilter>

 </crontab>

# 设置sersync传输后调用name指定的插件脚本,默认关闭

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

 </localpath>

</plugin>

</head>

-----------------------------

(编辑:佛山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读