作者:邓聪聪

  常用同步工具sync的进阶软件

  服务端的配置:

uid = rsync
gid = rsync
port =
use chroot = on
max connections =
timeout =
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
read only = false
list = false
fake super = yes
hosts allow = 172.16.16.0/
hosts deny = 0.0.0.0/
secrets file = /etc/rsyncd.password
auth users = rsync [backup]
path = /data

客户端在推送时,有这样一个报错,但不影响文件的传输:

[root@ data]# rsync -avzP a.txt backup@172.16.16.10::backup
Password:
sending incremental file list
a.txt
% .00kB/s :: (xfr#, to-chk=/)
rsync: chgrp "/.a.txt.llMDKO" (in backup) failed: Operation not permitted () ###无法操作 sent bytes received bytes 90.00 bytes/sec
total size is speedup is 0.04
rsync error: some files/attrs were not transferred (see previous errors) (code ) at main.c() [sender=3.1.]

解决后:

[root@ data]# rsync -avzP /root/data/b.txt rsync@172.16.16.10::backup
Password:
sending incremental file list
b.txt
% .00kB/s :: (xfr#, to-chk=/) sent bytes received bytes 56.40 bytes/sec
total size is speedup is 0.04

源同步服务器上,同步本端目录内容到目标服务器,用sersync:

  将 sersync2.5.4_64bit_binary_stable_final.tar.gz 文件解压后(主要用sersync、inotify)

[root@ansible-server ~]# cd sersync/
[root@ansible-server sersync]# ll
total
drwxr-xr-x. root root Mar : GNU-Linux-x86
drwxrwxrwx. rsync rsync Mar inotify-tools-3.14
-rw-r--r--. root root Mar : inotify-tools-3.14.tar.gz
-rw-r--r--. root root Mar : README.md
drwxrwxr-x. root root Mar : rsync-3.1.
-rw-r--r--. root root Mar : rsync-3.1..tar.gz

  为了方便管理调整目录结构:

[root@ansible-server sersync]# tree /usr/local/sersync/
/usr/local/sersync/
├── bin
│   └── sersync
├── conf
│   ├── conf-www.xml
│   ├── confxml.xml
│   └── confxml.xml-bak
└── log
├── rsync_fail_log
└── rsync_fail_log-www
mv GNU-Linux-x86/sersync /usr/local/sersync/bin/
mv GNU-Linux-x86/confxml.xml /usr/local/sersync/conf
[root@ansible-server sersync]# cat /usr/local/sersync/conf/confxml.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">
<host hostip="localhost" port=""></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="/tmp"> #需要监听的本地目录
<remote ip="172.16.16.10" name="backup"/> #目标及目标路径的模块
<!--<remote ip="192.168.8.39" name="tongbu"/>-->
<!--<remote ip="192.168.8.40" name="tongbu"/>-->
</localpath>
<rsync>
<commonParams params="-artuz"/>
<auth start="true" users="rsync" passwordfile="/etc/rsync.pwd"/> #目标服务器的rsync认证用户及密码,本端保存的认证密码文件
<userDefinedPort start="true" port=""/><!-- port= --> #监听端口
<timeout start="false" time=""/><!-- timeout= -->
<ssh start="false"/>
</rsync>
<failLog path="/usr/local/sersync/log/rsync_fail_log.sh" timeToExecute=""/><!--default every 60mins execute once-->
<crontab start="false" schedule=""><!--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=""/>
</localpath>
</plugin>
<plugin name="refreshCDN">
<localpath watch="/data0/htdocs/cms.xoyo.com/site/">
<cdninfo domainname="ccms.chinacache.com" port="" 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>

非常好用的sersync同步工具的更多相关文章

  1. Rsync数据同步工具及sersync同步工具

    Rsync简介 Rsync英文全称Remote synchronization,从软件的名称就可以看出来,Rsync具有可使本地和远程两台主机之间的数据快速复制同步镜像,远程备份的功能,这个功能类似s ...

  2. 三十、sersync高级同步工具实时数据同步架构

    一.项目介绍 Sersync项目利用inotity与rsync技术实现对服务器数据实时同步的解决方案,其中inotity用于监控sersync所在服务器上的文件变化. Sersync项目的优点: 1. ...

  3. Linux实战教学笔记21:Rsync数据同步工具

    第二十一节 Rsync数据同步工具 标签(空格分隔): Linux实战教学笔记-陈思齐 ---本教学笔记是本人学习和工作生涯中的摘记整理而成,此为初稿(尚有诸多不完善之处),为原创作品,允许转载,转载 ...

  4. rsync数据同步工具的配置

    rsync数据同步工具的配置 1. rsync介绍 1.1.什么是rsync rsync是一款开源的快速的,多功能的,可实现全量及增量的本地或远程数据同步备份的优秀工具.Rsync软件适用于 unix ...

  5. RSYNC 同步工具

    Rsync 数据同步工具 一.Rsync简介 1.检测一下你的机器上是否已经安装  --->可以通过yum安装  或者  源码 Server  192.168.201.151 Client    ...

  6. 【基础】:Rsync数据同步工具

    第二十一节 Rsync数据同步工具 1.1 Rsync介绍 1.1.1 什么是Rsync? 1.1.2 Rsync简介 1.3 Rsync的特性 1.1.4 Rsync的企业工作场景说明 1.2 Rs ...

  7. Java并发之CyclicBarrier 可重用同步工具类

    package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * Cyclic ...

  8. Java并发之CountDownLatch 多功能同步工具类

    package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * CountD ...

  9. Java核心知识点学习----线程同步工具类,CyclicBarrier学习

    线程同步工具类,CyclicBarrier日常开发较少涉及,这里只举一个例子,以做备注.N个人一块出去玩,相约去两个地方,CyclicBarrier的主要作用是等待所有人都汇合了,才往下一站出发. 1 ...

随机推荐

  1. python定时执行任务的三种方式

    #!/user/bin/env python # @Time :2018/6/7 16:31 # @Author :PGIDYSQ #@File :PerformTaskTimer.py #定时执行任 ...

  2. 数据库常用的事务隔离级别和原理?&&mysql-Innodb事务隔离级别-repeatable read详解

    转载地址:https://baijiahao.baidu.com/s?id=1611918898724887602&wfr=spider&for=pc https://blog.csd ...

  3. vi设置行号

     首先,我们先打开一个文件,用vim 文件名 就可以直接使用vim打开   我们事先写了一些内容在这个txt里面,我们可以看到如下内容   在这里,我们可以直接敲命令, :set number 或者 ...

  4. 在ConoHa上Centos7环境下源码安装部署LNMP

    本文记录了从源码,在Centos 7上手动部署LNMP环境的过程,为了方便以后对nginx和mariadb进行升级,这里采用yum的方式进行安装. 1.建立运行网站和数据库的用户和组 groupadd ...

  5. time、datetime、calendar

    time 1.  Python中表示时间的方式 l  时间戳 l  格式化的时间字符串 l  元组(struct_time)共九个元素.由于Python的time模块实现主要调用C库,所以各个平台可能 ...

  6. Xilinx FPGA引脚txt文件导入excel中

    需求 为了把xilinx FPGA的官方引脚文件txt转成excel文件(实际官网中有对应的csv文件就是excel文件了...) xilinx FPGA引脚地址:https://china.xili ...

  7. commons-httpclient 实现get和post请求

    引入的jar包为: <!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient --> &l ...

  8. macTypeError: slice indices must be integers or None or have an index method

    一般是由于Numpy的版本太高了(1.12对此进行了调整),有的时候传入numpy array里面的索引可能是浮点数,这个时候最好检查一下索引强制转换为int类型 或者安装低版本的numpy sudo ...

  9. Gym - 101982B Coprime Integers (莫比乌斯反演)

    题目链接:http://codeforces.com/gym/101982/attachments 题目大意:有区间[a,b]和区间[c,d],求gcd(x,y)=1,其中x属于[a,b],y属于[c ...

  10. ECS集群管理docker

    1. create ECR Repositories on AWS a. local server need install git/docker/awscli b. config aws: use ...