免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1790 | 回复: 0
打印 上一主题 下一主题

rsync在windows与windows服务器之间的同步设置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-17 16:58 |只看该作者 |倒序浏览

一、windows与windows同步1.准备两台机器:server-----192.168.0.201client-----192.168.0.2022.下载windows版的rsync工具具体软件下载链接我也忘了,不过在google应该可以搜索到。我也将它上传到CU上……

文件:
cwRsync_2.0.10_Installer.zip
大小:
2953KB
下载:
下载

文件:
cwRsync_Server_2.0.10_Installer.zip
大小:
2821KB
下载:
下载
server端:cwRsync_Server_2.0.10_Installer.zipclient端:cwRsync_2.0.10_Installer.zip3.安装 与配置SERVER:(1)安装cwRsync_Server_2.0.10_Installer.zip在开始程序中打开“start a unix bash shell”程序:进入一个类似cmd的终端,输入如下命令:$/bin/activate-user.sh输入l输入administrator后面全按回来结束(2)启动opensshd打开“控制面板”-->“管理工具”-->“服务”:找到一个opensshd的服务,启动它(3)配置rsyncd.conf配置文件编辑C:\Program Files\cwRsyncServer\rsyncd.conf,内容如下:use chroot = falsestrict modes = falsehosts allow = *log file = rsyncd.logpid file = rsyncd.pid# Module definitions# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work[rsync] path = /cygdrive/f/rsync   (此处路径代表f:\rsync目录)read only = yestransfer logging = yessecrets file = /cygdrive/f/rsyncd.secrets (4)启动rsync服务打开“控制面板”-->“管理工具”-->“服务”:找到一个RsyncServer的服务,启动它到此server端配置结束,接下来配置client端 。CLIENT:(1)安装client端软件包:cwRsync_2.0.10_Installer.zip(2)打开cmd,执行如下操作,测试服务端是否正常 启动服务 了:cd C:\Program Files\cwRsync\bintelnet 192.168.0.201 22telnet 192.168.0.201 873若上述测试成功,此时可执行同步计划:rsync -vzrtopg --progress --delete 192.168.0.201::rsync /cygdrive/d/test或者是:rsync -vzrtopg --progress --delete 192.168.0.201:/cygdrive/d/rsync /cygdrive/d/test(此时,会提示输入密码,用户名为administrator,密码则为192.168.0.201的管理员登录密码)至此,安装配置windows到windows间的同步已经OK如果定时同步server上的文件,可将其加入任务计划中。二、windows作为server时与linux间的同步1、准备机器,此时使用windows作为serverserver---192.168.0.201 (windows)client---192.168.0.132 (linux)2、经过上文的操作,此时可简化操作了进入linux主机client同步server:#rsync -vzrtopg --progress --delete 192.168.0.201::rsync /test 三、linux作为server时与windows间的同步1、准备机器,此时使用linux作为serverserver---192.168.0.132 (linux)client---192.168.0.202 (windows)2、安装与配置linux主机的rsync(1)查看linux上是否安装rsync:#rpm -qa|grep rsync若无则安装,或者使用tar编译安装#rpm -ivh rsync-2.6.8-3.1.rpm(2)打开rsync服务#chkconfig xinetd on#chkconfig rsync on(3)创建 rsyncd.conf 文件#touch /etc/rsyncd.conf#vi /etc/rsyncd.conf(内容如下:)uid = nobodygid = nobodymax connections = 4[www]path = /wwwcomment = BACKUP WWWignore errorsread only = yeslist = noauth users = wwwuserhosts allow=192.168.0.202secrets file = /etc/wwwuser.pass(4)启动基于xinetd进程的rsync服务#/etc/init.d/xinetd start3、配置windows的rsync客户端 (1)安装client端的rsync包(2)打开cmd,执行同步计划:cd C:\Program Files\cwRsync\binrsync -vzrtopg --progress --delete root@192.168.0.132::www /cygdrive/d/test(此时须输入root用户的密码,就可进行同步了。)至此,全部配置完成。注:要使用加密的同步,可使用……rsync -e 'ssh -p 2002' -vzrtopg --progress --delete root@192.168.0.132::www /cygdrive/d/test

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/79554/showart_1200396.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP