免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6812 | 回复: 14
打印 上一主题 下一主题

rsync 完全配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-08-23 08:27 |只看该作者 |倒序浏览
配置 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 postfixxx >;>;/etc/rsyncd.pwd
[root@linuxas3 root]# echo netkillerxx >;>;/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

论坛徽章:
0
2 [报告]
发表于 2005-08-23 12:01 |只看该作者

rsync 完全配置

谢谢啊

论坛徽章:
0
3 [报告]
发表于 2005-08-23 17:40 |只看该作者

rsync 完全配置

嗯,这样就“完全”了吗?

论坛徽章:
0
4 [报告]
发表于 2005-08-24 09:31 |只看该作者

rsync 完全配置

把自己的配置一发,什么都不说,也算是完全了。

论坛徽章:
0
5 [报告]
发表于 2005-08-24 12:06 |只看该作者

rsync 完全配置

我用rsync一般不启rsyncd的,而是走ssh隧道!
rsync 的-e参数!

论坛徽章:
0
6 [报告]
发表于 2005-09-29 14:33 |只看该作者

rsync 完全配置

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

[root@linuxas3 root]# echo postfixxx >;>;/etc/rsyncd.pwd
[root@linuxas3 root]# echo netkillerxx >;>;/etc/rsyncd.pwd
[root@linuxas3 root]# chmod 600 /etc/rsyncd.pwd


问楼主:xxx是表示的用户名和密码吗?

论坛徽章:
0
7 [报告]
发表于 2005-09-29 14:53 |只看该作者

rsync 完全配置

论坛徽章:
5
巳蛇
日期:2013-08-28 09:26:15CU十二周年纪念徽章
日期:2013-10-24 15:41:34射手座
日期:2013-10-31 09:13:04射手座
日期:2014-02-11 13:18:34天秤座
日期:2014-03-25 09:22:28
8 [报告]
发表于 2005-09-29 14:53 |只看该作者

rsync 完全配置

哦,是netkiller 写的啊。。

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
9 [报告]
发表于 2005-09-29 14:55 |只看该作者

rsync 完全配置

问一下(这个东西做什么用):>;>;??

论坛徽章:
0
10 [报告]
发表于 2005-09-29 15:21 |只看该作者

rsync 完全配置

主机间通过网络数据同步。可以通过ssh的隧道传送数据
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP