一,安装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=====
==========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"
阅读(2731) | 评论(0) | 转发(0) |