server A
vi /etc/xinetd.d/rsync

service rsync
{
        disable = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}
service xinetd restart

vi /etc/rsyncd.conf

uid=nobody
gid=nobody
use chroot=no
max connections=4
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
log file=/var/log/rsyncd.lock
[web]
path=/data0/htdocs/blog/
ignore errors
read only=ture
list=false
hosts allow=192.168.2.20

auth users=backup
secrets file=/etc/backup.pass


vi /etc/backup.pass
backup:123456

chmod 600 /etc/backup.pass

server B
vi /etc/rsync_client.pass
123456

chmod 600 /etc/rsync_client.pass

vi /root/backup.sh
rsync -avzu --progress --delete --password-file=/etc/rsync_client.pass backup@192.168.2.10::web /data0/htdocs/blog/

chmod 744 /root/backup.sh

crontab -e
*/5 * * * * /root/backup.sh