准备安装文件: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中。
首先,安装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
服务器安装路径: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
# 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/