WINDOWS下 cwRsyncServer cwRsync搭建步骤

——————————————–我的服务器端配置

服务器端的 rsyncd.conf 配置

use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
secrets file = /cygdrive/c/ICW/rsyncd.secrets   #这个文件里放的就是用户名和密码 这种格式  mark:123456

# ———–匿名用这2个 不用这个有时候会连接不上,但是用了一定要对相应的 模块设置密码,比如下面的 test 模块
uid = 0
gid = 0
# ———–

# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/c/test
read only = true
transfer logging = yes
auth users = mark  #这个灰常重要,没这个别人不要密码也能访问

————————————————这个是我的客户端同步参数

rsync.exe -vzrt –progress –password-file=/cygdrive/”D/Program Files/cwRsync/sync_jack.pws” sync_jack@192.168.1.2::test/ /cygdrive/c/test/

————————————————-

再下面的就是在网上找的了,大家可以参考:

1、http://rsync.samba.org/ 下载cwRsync客户端(cwRsync)和服务器端(cwRsyncServer)。
2、在客户端安装cwRsync。
3、在服务端安装cwRsyncServer。
4、配置服务端rsyncd.conf。
例如:
[test]
path=e:/test
comment=Data Backup for Summer’s laptop
read only=no
use chroot=no
strict modes = no
transfer logging=yes
use lfs=yes
hosts allow=172.25.43.57
hosts deny=*
/*上面是设置了一个test模块,相关配置在下面解释*/
5、重起服务端cwRsyncServer。
6、搭建已经完毕,可以开始命令操作。
rsync -avrp /test/ administrator@172.25.43.58::test –password-file=1234567
(表示将客户端test目录下文件备份到服务器test模块下。如果将/test/放后面,表示将服务器test模块下目录备份带客户端/test/下。)
选项说明:
-v, –verbose 详细模式输出
-q, –quiet 精简输出模式
-c, –checksum 打开校验开关,强制对文件传输进行校验
-a, –archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于-rlptgoD
-r, –recursive 对子目录以递归模式处理
-R, –relative 使用相对路径信息
其他参数可以查看rsync相关手册。

相关解释:
uid = nobody
gid = nobody

#uid = 0  这样也可以
#gid = 0

use chroot = no        # 不使用chroot
max connections = 4        # 最大连接数为4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log    # 日志记录文件
[inburst]            # 这里是认证的模块名,在client端需要指定
path = /home/inburst/python/    # 需要做镜像的目录
comment = BACKUP CLIENT IS SOLARIS 8 E250
ignore errors            # 可以忽略一些无关的IO错误
read only = yes            # 只读
list = no            # 不允许列文件
hosts allow=172.25.43.57  #允许连接IP
auth users = inburst        # 认证的用户名,如果没有这行,则表明是匿名
secrets file = /etc/inburst.pas    # 认证文件名

注:
为安全考虑,在设置服务端rsyncd.conf模块时,一定要加上auth users = inburst,secrets file = /etc/inburst.pas,密码写到一个文件中inburst.pas。
执行命令时:rsync -avrp /test/ inburst@172.25.43.158::test –password-file=inburst.pas。



发表评论

您的电子邮箱地址不会被公开。

34 − = 25