# vim /etc/xinetd.d/rsync #修改disable = no,flags = IPv4
# mkdir /etc/rsyncd # vim /etc/rsyncd/rsyncd.conf #修改配置文件如下 # GLOBAL OPTIONS motd file=/etc/motd port=873 pid file=/var/run/rsyncd.pid lock file = /var/lock/rsyncd log file=/var/log/rsyncd transfer logging = yes log format = [op]:%o [ip]:%a [module]:%m [path]:%P [file]:%f [size]:%l syslog facility=daemon max connections=100 [recv] comment = "recv data from 57.25" path = /opt/rsync_data/recv #这边的目录的宿主要改为apprun,在这里同步过程中使用的是普通账户apprun list = yes use chroot = yes uid = apprun gid = apprun read only = no write only = no exclude = include = auth users = rsync secrets file = /etc/rsyncd/rsyncd.secrets strict modes = yes hosts allow = 172.16.57.25 hosts deny = * # ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
# vim /etc/rsyncd/rsyncd.secrets rsync:111111 #格式 用户名:口令 #chmod 600 /etc/rsyncd/rsyncd.secrets #权限设为600,否则启动会报错
# /etc/init.d/xinetd start # netstat -tpln | grep 873 #查看873端口是否已经在监听了
# tar xzvf sersync2.5_64bit_binary_stable_final.tar.gz # mv GNU-Linux-x86 /opt/programs/sersync #解压并拷贝到安装目录
<?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="true"/>
<closeWrite start="true"/>
<moveFrom start="true"/>
<moveTo start="true"/>
<attrib start="true"/>
<modify start="true"/>
</inotify>
<sersync>
<localpath watch="/opt/rsync_data/send"> #监控目录,一旦本地目录有文件变化,将同步到服务端
<remote ip="172.16.57.26" name="recv"/>#服务端ip和同步模块
</localpath>
<rsync>
<commonParams params="-artuz"/> #rsync同步参数
<auth start="true" users="rsync" passwordfile="/etc/rsync.pas"/> #服务端认证密码
<userDefinedPort start="false" port="873"/>
<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" name="command"/>
</sersync>
</head>
# vim /etc/rsync.pas #在相应的目录下配置身份验证文件,里面输入服务端的密码,并chmod 600 # chmod 600 /etc/rsync.pas
# ./sersync2 -d -o confxml.xml
cps = 500 30 instances = UNLIMITED per_source = UNLIMITED
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有