环境:
192.168.172.131服务端
192.168.172.133客户端
服务端:
1 yum -y install rsync
2 mkdir /root/abc
cd /root/abc
touch aaa
3 vim /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = yes
address = 192.168.172.131
port 873
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
hosts allow = 192.168.172.0/24
[wwwroot]
path = /root/abc
comment = Document Root of www.51xit.top
read only =no
dont comperss = *.gz *.bz2 *.tgz *.zip *.rar *.z
auth users =backuper
secrets file = /etc/rsyncd_users.db
4 cat /etc/rsyncd_users.db
backuper:pwd123
chmod 600 /etc/rsyncd_users.db
systemctl stop firewalld
5 rsync --daemon
netstat -anpt |grep rsync
tcp 0 0 192.168.172.131:873 0.0.0.0:* LISTEN 12173/rsync
客户端
yum -y install rsync
systemctl stop firewalld
mkdir /root/abc
chmod 777 /root/abc
vi /etc/server.pass
chmod 600 /etc/server.pass
rsync -az --password-file=/etc/server.pass backuper@192.168.172.131::wwwroot /root/abc
cd abc/
ll
crontab -e
到这里就结束了