rsync和sersync实时同步文件

目标端:192.168.88.81
ide

源端:192.168.88.82

目标端 安装 rsync
源端 安装 rsync inotify  sersync

目标端
建立文件 /etc/rsync.conf


ui

uid=rootgoogle

gid=rootspa

max connections=360003d

#默认为true,修改成no,增长对目录文件软链接的备份code

use chroot=noxml

log file=/var/log/rsyncd.logblog

pid file=/var/run/rsyncd.pidget

lock file=/var/run/rsyncd.lockit

max connections=36000

ignore errors = yes

#设置rsync服务端文件为读写权限

read only = no

#认证的用户名与系统账户无关在认证文件作配置,若是没有这行则代表是匿名

auth users = root

#密码认证文件,格式(虚拟用户名:密码)

secrets file = /passwd

#这里是认证的模块名,在client端须要指定,能够设置多个模块和路径

[rsync]

#自定义注释

comment  = rsync

#文件存放的路径

path=/data/

建立文件/passwd
输入帐号密码  root:11111111
设置权限600

源端
下载 
https://sersync.googlecode.com/files/sersync2.5.4_64bit_binary_stable_final.tar.gz
解压缩

修改配置文件
 confxml.xml
这里auth 有个start参数,默认是false,必定要改成true
psb.png
建立文件/passwd
输入帐号密码  11111111
设置权限600

最后运行下面的命令
nohup /root/sersync/sersync2 -r -d -o /root/sersync/confxml.xml > /root/sersync/sersync.log 2>&1 &

相关文章
相关标签/搜索