yum安装rsync

一、源主机

yum -y install rsync

二、目标主机

(1)安装服务

yum -y install rsync

(2)修改配置项

vi /etc/rsyncd.conf

[module]
path = /data/wwwroot/rsync
list = true
uid = root
gid = root
read only = false
auth users = web
secrets file = /etc/rsyncd.secrets

(3)赋予密码文件权限

chmod 600 /etc/rsyncd.secrets

(4)运行服务

systemctl start rsyncd

systemctl enable rsyncd 

三、源主机执行rsync

rsync -arqz --password-file=/etc/rsyncd.secrets /root/test-rsync.php web@rsync.org::module

你可能感兴趣的:(Linux)