安装脚本
#!/bin/sh
apt-get install rsync xinetdsed -in-place -e s/RSYNC_ENABLE=false/RSYNC_ENABLE=inetd/ /etc/default/rsync
cp rsync /etc/xinetd.d/rsync
cp rsyncd.conf /etc/rsyncd.conf
cp rsyncd.secrets /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets
/etc/init.d/xinetd restart
配置文件内容如下:
rsync
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
rsyncd.conf
max connections = 2
log file = /var/log/rsync.log
timeout = 300[etc]
comment = etc
path = /etc
read only = no
list = yes
uid = root
gid = root
auth users = user
secrets file = /etc/rsyncd.secrets
rsyncd.secrets
user:pass
使用方法:
rsync -tvzrp –password-file ./rsync.password /etc/hosts user@dest_host::etc
My name is Hugo Zhu.



