yum install rsync
vi /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 30
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
hosts allow = 127.0.0.1,192.168.130.199
read only = yes
auth users = root
secrets file = /etc/rsync.pas
[bbsdata]
path = /file
vi /etc/rsync.pas
root:123456
chmod 700 /etc/rsync.pas
重启
ps -ef |grep rsynckillall rsync
rm -rf /var/run/rsync* && rsync --daemon
客户端:
rsync -aP --delete root@192.168.130.199::dbbak/199news /www/dbbak --password-file=/www/rsync.pas
vi rsync.pas
123456
chmod 400 /www/rsync.pas