发新话题
打印

[转帖] rsync 完全配置

[转帖] rsync 完全配置

配置 rsync

系统环境

[root@linuxas3 root]# uname -a
Linux linuxas3.9812.net 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux


安装rsync

在AS3 第二张CD上找到rsync-2.5.6-20.i386.rpm

[root@linuxas3 root]# cd /mnt
[root@linuxas3 mnt]# mount cdrom
[root@linuxas3 mnt]# cd cdrom/RedHat/RPMS
[root@linuxas3 RPMS]# rpm -ivh rsync-2.5.6-20.i386.rpm


配置/etc/rsyncd.conf

在rh9,as3系统上rsync安装后,并没有创建rsyncd.conf文档,笔者是自己创建的rsyncd.conf文档

[root@linuxas3 root]# vi /etc/rsyncd.conf

uid=nobody
gid=nobody
max connections=4
use chroot=no
log file=/var/log/rsyncd.log
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
#auth users=root
secrets file=/etc/rsyncd.pwd

[postfix]
path=/var/mail
comment = backup mail
ignore errors
read only = yes
list = no
auth users = postfix

[netkiller]
path=/home/netkiller/web
comment = backup 9812.net
ignore errors
read only = yes
list = no
auth users = netkiller

[pgsqldb]
path=/var/lib/pgsql
comment = backup postgresql database
ignore errors
read only = yes
list = no



选择说明

uid = nobody
gid = nobody
use chroot = no # 不使用chroot
max connections = 4 # 最大连接数为4
pid file = /var/run/rsyncd.pid #进程ID文件
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log # 日志记录文件
secrets file = /etc/rsyncd.pwd # 认证文件名,主要保存用户密码,权限建议设为600,所有者root

[module] # 这里是认证的模块名,在client端需要指定
path = /var/mail # 需要做镜像的目录
comment = backup xxxx # 注释
ignore errors # 可以忽略一些无关的IO错误
read only = yes # 只读
list = no # 不允许列文件
auth users = postfix # 认证的用户名,如果没有这行,则表明是匿名

[other]
path = /path/to...
comment = xxxxx


密码文件

在server端生成一个密码文件/etc/rsyncd.pwd

[root@linuxas3 root]# echo postfix:xxx >>/etc/rsyncd.pwd
[root@linuxas3 root]# echo netkiller:xxx >>/etc/rsyncd.pwd
[root@linuxas3 root]# chmod 600 /etc/rsyncd.pwd


启动rsync daemon

[root@linuxas3 root]# rsync --daemon


测试

[root@linux docbook]# rsync rsync://www.9812.net/netkiller

[root@linux tmp]# rsync rsync://netkiller@www.9812.net/netkiller
Password:

[chen@linux temp]$ rsync -vzrtopg --progress --delete postfix@www.9812.net::postfix /tmp
Password:


rsync rsync://认证用户@主机/模块

rsync -vzrtopg --progress --delete 认证用户@主机::模块 /mirror目录

添加到启动文件

echo "rsync --daemon" >> /etc/rc.d/rc.local


TOP

发新话题
  清除 Cookies - 联系我们 - 邮件技术资讯网 - Archiver - WAP - 繁體中文
当前时区 GMT+8, 现在时间是 2008-7-7 07:53

本论坛为非盈利中立机构,论坛所有言论纯属发表者个人意见,与《 邮件技术资讯网》论坛立场无关。内容所涉及的版权和法律相关事宜请参考各自所有者的条款。
如果认定侵犯了您的权利,请联系我们尽快处理。本论坛原创内容请联系本站后再行转载并务必保留我站信息。此声明修改不再另行通知,本论坛保留最终解释权。
*本论坛QQ群:1#群2233231(推荐) 2#群2598254(已满) 3#群15974064(推荐) 4#群14173252(推荐)*
Powered by Discuz! 6.0.0  © 2001-2007 Comsenz Inc.