配置目标服务器(放备份的机器)
//关闭防火墙和selinux
[root@server ~]# systemctl stop firewalld
[root@server ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@server ~]# setenforce 0
[root@server ~]# getenforce
Permissive
//安装rsyns服务端软件 (网络源才有rsync)
[root@server ~]# yum -y install rsync
//填写rsyncd.conf配置文件 (后方注释不要在配置文件中)
log file = /var/log/rsyncd.log # 日志文件位置,启动rsync后自动产生这个文件,无需提前创建
pidfile = /var/run/rsyncd.pid # pid文件的存放位置
lock file = /var/run/rsync.lock # 支持max connections参数的锁文件
secrets file = /etc/rsync.pass # 用户认证配置文件,里面保存用户名称和密码,必须手动创建这个文件
[etc_from_client] # 自定义同步名称
path = /sh/ # rsync服务端数据存放路径,客户端的数据将同步至此目录
comment = sync etc from client
uid = root # 设置rsync运行权限为r