CwRsync安装、设置、使用教程

1、在服务器上安装服务端,默认安装即可。服务\客户端可上官网下载:https://www.itefix.no/i2/cwrsync-get

 

2、编辑配置文件rsyncd.conf(默认安装在C:\Program Files\ICW目录),使其包含以下内容

 

uid = 0

gid = 0

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log

pid file = rsyncd.pid

port = 10086

max connections = 4

 

# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

[remote_backup]

path = /cygdrive/e

read only = false

transfer logging = yes

lock file = rsyncd.lock

 

(path = /cygdrive/e表示存放备份的目录为E:\)

 

3、将用户SvcCWRSYNC(安装服务端后自动创建,为rsync服务的标识用户)从Users组删除,启动RsyncServer服务,并将启动类型设置为自动

 

image001

 

如成功启动,可看到服务器已开启对应的端口:

image002

 

4、授予SvcCWRSYNC账户对备份目录的读取权限。

 

5、设置防火墙例外,允许客户端IP连接:

 

新建入站规则,选择端口:

image003

输入10086:

image004

设置规则名称:

image005

编辑此规则属性,选择“作用域”,将远程IP地址设置为客户端的IP:

image006

 

6、在远备服务器上安装客户端,默认安装。装好以后,telnet测试能否正常连接服务端的10086端口。

 

7、进入远备服务器的D:\scripts目录,创建远备脚本(如cw103_remote_backup.bat),内容如下:

 

"C:\Program Files\cwRsync\bin\rsync" -av --exclude-from="/cygdrive/d/scripts/cw103_exclude.txt" rsync://205.209.148.231:10086/remote_backup /cygdrive/e/cw103

 

(/cygdrive/d/scripts/cw103_exclude.txt这个文件的内容指定了所需排除的文件(夹)列表,即不进行传输的文件(夹)列表;205.209.148.231为服务端的IP, /cygdrive/e/cw103表示远备的存放路径为E:\cw103)

 

创建排除文件cw103_exclude.txt,内容如下:

 

$RECYCLE.BIN

1b984d2a2fbabd2371de17ad

cw*

System Volume Information

test

VHDtools

WindowsImageBackup

 

(支持特殊文件名;支持通配符;不支持中文。请根据实际情况做必要的调整。)

 

8、运行脚本D:\scripts\cw103_remote_backup.bat,看是否有开始传输备份。

 

 

增加安全验证

pid file = rsyncd.pid

secrets file = password # 这里指定了用户名密码文件在其安装目录里,名字叫 password,其内容是txt编辑为 test:qwer 前面是用户名,后面是密码.

 

rsyncd.conf如下

uid = 0

gid = 0

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log

port = 10086

pid file = rsyncd.pid

secrets file = password

# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

[test]

path = /cygdrive/e/rstest

read only = false

transfer logging = yes

auth users = test

 

命令

C:\Program Files\cwRsync\bin\rsync" -av --exclude-from="/cygdrive/d/scripts/cw103_exclude.txt" rsync://test@127.0.0.1:10086/test /cygdrive/e/cw103

1条评论

发表评论