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 &

相關文章
相關標籤/搜索