ubuntu安装:sudo apt-get -y install rsync
Server 端配置:
cat rsyncd.conf
pid file = /var/run/rsyncd.pid
port = 873
address = 172.16.5.100
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow=172.16.3.0/255.255.255.0
log file = /var/log/rsync.log
[data]
path = /home/luoshaohui/sql
ignore errors
list=false
read only = true
auth users = root
secrets file = /etc/rsyncd/rsyncd.secrets
ps: 要把 rsync.secrets 权限设置为 600 ,不然备份不成功!
然后启动 sudo /usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf
Client:
之需要安装rsync,不需要配置,然后就是同步了:
rsync -avzP root@172.16.5.100::data ./
转载于:https://blog.51cto.com/iter2012/1536823