作者:邓聪聪

  常用同步工具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. 02-MySQL基础

    MySQL基础 1.存储引擎 1.1MyISAM MySQL5.5以及之前默认存储引擎MyISAM 如果应用是以读操作和插入操作为主,只有很少的更新和删除操作,并且对事务的完整性.并发性要求不高,那么 ...

  2. jmeter学习记录--04--Beanshell

    一.什么是Bean Shell BeanShell是一种完全符合Java语法规范的脚本语言,并且又拥有自己的一些语法和方法;BeanShell是一种松散类型的脚本语言(这点和JS类似); BeanSh ...

  3. AOP - 2 实例(SpringBoot 注解方式)

    1.创建Spring Boot项目 创建一个Spring Boot 项目,然后pom中引入web 模块与AOP相关依赖. <dependency> <groupId>org.s ...

  4. Docker 案例: 在容器中部署静态网站

    ----------------知识点------------ 容器的端口映射: docker  run  [-P] [-p] -P,–publish-all=true | false,大写的P表示为 ...

  5. icpc 南昌邀请赛网络赛 Max answer

    就是求区间和与区间最小值的积的最大值 但是a[i]可能是负的 这就很坑 赛后看了好多dalao的博客 终于a了 这个问题我感觉可以分为两个步骤 第一步是对于每个元素 以它为最小值的最大区间是什么 第二 ...

  6. Jetson TX1 compile pytorch issues

    1. c++: internal compiler error: Killed (program cc1plus) reason: memory out, need swapfile 2. NCCL ...

  7. .Net Core 环境下构建强大且易用的规则引擎

    本文源码: https://github.com/jonechenug/ZHS.Nrules.Sample 1. 引言 1.1 为什么需要规则引擎 在业务的早期时代,也许使用硬编码或者逻辑判断就可以满 ...

  8. icns图标的制作

    1. 准备一张无损的png图片(1024x1024) 2. 新建一个文件夹 必须要以iconset为后缀 $ mkdir hgl_pngpic.iconset 3. 使用sips 命令剪切10个不一样 ...

  9. did not finish being created even after we waited 189 seconds or 61 attempts. And its status is downloading

    did not finish being created even after we waited 189 seconds or 61 attempts. And its status is down ...

  10. Linux-文件管理

    文件管理 创建.复制.删除.移动.查看.编辑.压缩.查找 Linux目录结构 Windows: 以多根的方式组织文件 C:\ D:\ E:\Linux: 以单根的方式组织文件 / /目录结构: FSH ...