CentOS rsync同步

Standard

A:192.168.0.1
B:192.168.0.2

A:
yum -y install xinetd
vi /etc/xinetd.d/rsync

将“disable = no
chkconfig xinetd on
service xinetd start
vi /etc/rsyncd.conf

[site] #name
path = /var/www/html #copied directory
hosts allow = 192.168.0.2
hosts deny = *
list = true
uid = root
gid = root

B:
vi /etc/rsync_exclude.lst #Write directory or files you don’t want to copy.
no.txt
nono.txt

rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst 192.168.0.1::site /home/backup

crontab -e

00 02 * * * rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst 192.168.0.1::site /home/backup

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.