使用cwRsync同步windows系统间的文件

准备安装文件:cwRsync_Server_2.1.3_Installer.zip(服务器)、cwRsync_2.1.3_Installer.zip(客户端)
为了测试方便,我的server和client安装在同一台机器上。
首先,安装cwRsync_Server_2.1.3_Installer.zip(服务器),完成后到windows“服务”中开启RsyncServer服务,
安装cwRsync_2.1.3_Installer.zip(客户端),完成后将C:\Program Files\cwRsync\bin(客户端安装路径)设置到path中。
服务器配置:
服务器安装路径:C:\Program Files\cwRsyncServer
编辑:C:\Program Files\cwRsyncServer\rsyncd.conf
-------------------------------------------------
use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid
secrets file = password.txt
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]
path = /cygdrive/c/db
read nly = false
transfer logging = yes
auth users = byfree
-------------------------------------------------
上面配置文件中:
hosts allow指定允许访问的客户端IP,*表示客户端IP不受限制
secrets file指定口令文件,格式为username:password,存放路径为C:\Program Files\cwRsyncServer\password.txt
path = /cygdrive/c/db,表示windows的c:\db路径
auth users这里设置的用户是password.txt文件中的username

客户端配置:
客户端安装路径:C:\Program Files\cwRsync
编辑一个bat文件,便于同步
编辑rsy.bat
-------------------------------------------------
rsync -vzrtopg --progress --delete byfree@172.17.125.115::test /cygdrive/c/aa/
-------------------------------------------------
byfree@172.17.125.115 byfree是服务器端password.txt中的username,IP地址是server ip
::test 是服务器端配置文件rsyncd.conf中的[test]
/cygdrive/c/aa/ 是客户端路径c:\aa
执行rsy.bat,输入口令(password.txt中的password),客户端目录c:\aa将与服务器端目录c:\db同步。
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17997/viewspace-609568/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17997/viewspace-609568/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值