Posted by zuzhihui in Linux技术 on 2009/09/30 with No Comments
rsync是Linux下最好的同步软件,本文记录了在centos 5 VPS下配置rsync服务端的过程。
安装:
yum install -y rsync xinetd
然后rpm -ql rsync就可以看到rsync安装了哪些文件。编辑/etc/xinetd.d/rsync文件,修改disable=no,然后重启xinetd:
/etc/init.d/xinetd restart
创建文件 /etc/rsyncd.conf 内容如下:
pid file = /var/run/rsyncd.pid
port = 873
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow=68.68.99.184/255.255.255.0 216.18.195.23/255.255.255.0
hosts deny=*
max connections = 5
motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
[public]
path = /home/pics/www
list=yes
ignore errors
auth users = user
secrets file = /etc/rsyncd.secrets
comment = pics www
创建文件 /etc/rsyncd.motd 内容随便写即可
创建文件 /etc/rsyncd.secrets 内容是用户名和密码,比如:
user:password
然后执行如下命令:
chmod 700 /etc/rsyncd.secrets
这样就配置好了,在客户端就可以用rsync命令了,比如:
rsync rsync://user@216.18.195.23/
rsync --recursive --times --links --hard-links --delete -av rsync://user@216.18.195.23/public /home/pics/www
要发表评论,您必须先登录。
近期评论