免费注册 查看新帖 |

Chinaunix

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

rsync [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-20 18:40 |只看该作者 |倒序浏览
一,安装rsync

二,配置
   1,服务端
       (1)
         供rsync客户端访问的用户
       adduser
       rsyncuser
       (2)
          配置rsyncd.conf
         =========rsyncd.conf START =======

uid=nobody
gid=nobody
max connections=10
use chroot=no
log file=/var/log/rsyncd.log
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
secrets file=/etc/rsyncd.pwd

[admin_web]
path=/services/admin/data
comment= apache admin data
ignore errors
read only = yes
list = no
auth users = rsyncuser


[serv_web]
path=/services/serv/data
comment= apache madserving data
ignore errors
read only = yes
list = no
auth users = rsyncuser



=============rsyncd.conf END========
     

(3)
添加密码文件
=========rsyncd.pwd  START====
rsyncuser:pas
=========rsyncd.pwd  END======
修改rsyncd.pwd属性为600


2
客户端
(1)
添加密码文件
=========rsync.pwd  START====
rsyncuser:pas
=========rsync.pwd  END======
修改rsync.pwd  属性为600

(2)
建立同步脚本
=========rsyncfrom101.sh START=====
#!/bin/sh
#/usr/local/bin/rsync -vrtopg --progress
[email=rsyncuser@172.16.0.101::admin_web]rsyncuser@172.16.0.101::admin_web[/email]
/services/admin/data/ --password-file=/etc/rsync.pwd
/usr/local/bin/rsync -vrtopg --progress
[email=rsyncuser@172.16.0.101::serv_web]rsyncuser@172.16.0.101::serv_web[/email]
/services/serv/data/ --password-file=/etc/rsync.pwd
==========rsyncfrom101.sh END ======


三,启动
======rc.conf====
rsyncd_enable="YES"
===================
rsync --deamon



cat /etc/rc.d/rsyncd.sh
#!/bin/sh
#
# $FreeBSD: ports/net/rsync/files/rsyncd.sh.in,v 1.2 2006/02/20 20:47:29 dougb Exp $
#

# PROVIDE: rsyncd
# REQUIRE: LOGIN
# BEFORE:  securelevel
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `rsyncd':
#
#rsyncd_enable="YES"
#
# See rsync(1) for rsyncd_flags
#

. "/etc/rc.subr"

name="rsyncd"
rcvar=`set_rcvar`

command="/usr/bin/rsync"
command_args="--daemon"
pidfile="/var/run/$name.pid"
required_files="/etc/$name.conf"

# read configuration and set defaults
load_rc_config "$name"
: ${rsyncd_enable="NO"}
: ${rsyncd_flags=""}

run_rc_command "$1"


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4490/showart_174217.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP