一、一键完成rsync服务端
首先在服务端写一个脚本
vim install_rsync_server.sh
#!/bin/sh
#by liyu 2021-3-22
#(1)安装
yum install rsync -y
#(2) 配置配置文件 /etc/rsyncd.conf
cp /etc/rsyncd.conf{
,.ori}
cat>/etc/rsyncd.conf<<EOF
uid = rsync
gid = rsync
use chroot = no
fake super = yes
max connections = 200
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 192.168.119.0/24
auth users = rsync_backup
secrets file = /etc/rsync.password