首页 > 服务器 > Win服务器 > 正文

在Windows中配置Rsync同步文件的方法

2020-07-28 14:55:15
字体:
来源:转载
供稿:网友

Rsync是一款不错的文件免费同步软件,可以镜像保存整个目录树和文件系统,同时保持原来文件的权限、时间、软硬链接。第一次同步时 rsync 会复制全部内容,下次只传输修改过的文件部分。传输数据过程中可以实行压缩及解压缩操作,减少带宽流量。支持scp、ssh及直接socket方式连接,支持匿名传输。支持Linux,Window平台。写本文的时候,window版最新版为4.0.5版

官网:http://rsync.samba.org/

Linux版下载:http://rsync.samba.org/download.html

Windows版下载:https://www.itefix.no/i2/cwrsync-get 选(Free Edition 免费版)

客户端:cwRsync 4.0.5 Installer

服务端:cwRsyncServer 4.0.5 Installer

现在官方开始了收费版本,建议从错新网之家下载免费版本

cwRsync win 服务器同步软件 cwRsync_2.1.5_Installer.zip 服务器数据同步 服务器端 cwRsync_Server_2.1.5_Installer.zip 服务器文件同步 cwRsync_3.1.0_Installer.zip 服务器文件同步软件 服务器端 cwRsyncServer_3.1.0_Installer.zip

一、安装配置 Rsync 服务端

Window版服务端:

1. 点击服务端安装程序进行安装,安装过程中提示输入服务端程序以服务运行时的用户名,密码。可以自定义,也可以用默认的用户名密码设置。

2. 安装完成之后,进入程序安装目录根目录,打开配置文件(如:C:/Program Files/ICW/rsyncd.conf ),进入配置。

复制代码 代码如下:
use chroot = false
strict modes = false
lock file = rsyncd.lock
hosts allow = 192.168.1.21
max connections = 5
port = 28950
pid = 0
uid = 0

log file = /cygdrive/f/RsyncLog/rsyncd.log

# Module definitions
# Remember cygwin naming conventions : c:/work becomes /cygdrive/c/work

[data_backup]
path = /cygdrive/f/dataBackup
auth users = dbbackuper
secrets file = /cygdrive/e/Setting/Rsync/rsync_db.ps
read only = no
list = no
transfer logging = yes

错新网之家用的

复制代码 代码如下:
use chroot = false
strict modes = false
hosts allow = 222.186.55.55
log file = rsyncd.log
pid file = rsyncd.pid

# Module definitions
# Remember cygwin naming conventions : c:/work becomes /cygwin/c/work
#
[dddown]
path = /cygdrive/d/webroot/downjb51
read only = false
transfer logging = yes
auto user=wtjb51
secrets file=wtjb51.conf

[scjb51]
path = /cygdrive/d/webroot/scjb51
read only = false
transfer logging = yes
auto user=wtjb51
secrets file=wtjb51.conf

以上Windows目录的写法,应该按照POSIX风格来写,默认配置文件的写法cygwin貌似不工作,而要写成cygdrive,如D:/data,要写成/cygdrive/d/data。

以上配置只允许192.168.1.21访问,这里按需修改。

strict modes = false 不验证用户密码,

pid = 0,uid = 0指定匿名访问。

auth users : 指访问data_backup的用户名

secrets file : data_backup用户名对应的密码文件。

 

3. 新建密码文件:E:/Setting/Rsync/rsync_db.ps 。如:

root:root

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表