<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>haohtml&#039;s blog &#187; rsync</title>
	<atom:link href="http://blog.haohtml.com/index.php/tag/rsync/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.haohtml.com</link>
	<description>haohtml&#039;s life and works blog</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:45:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>windows下rsync的安装配置【数据同步】</title>
		<link>http://blog.haohtml.com/index.php/archives/654</link>
		<comments>http://blog.haohtml.com/index.php/archives/654#comments</comments>
		<pubDate>Sat, 29 Nov 2008 00:59:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[数据同步]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=654</guid>
		<description><![CDATA[    之前有转载了一篇《rsync中文手册，使用rsync实现网站镜像和备份》，介绍的是Linux下的安装配置，不过使用流程还是一样的。

rsync的配置环境
软件平台:windows2003
软件版本:cwRsync_2.0.10_Installer cwRsync_Server_2.0.10_Installer
硬件平台:dell2950 cpu1.6G*4 内存:4G 硬盘:1G*6 RAID5

===安装===

在WINDOWS环境下安装rsync要安装服务端和客户端

服务器端安装:运行cwRsync_Server_2.0.10_Installer
客户端安装:运行cwRsync _2.0.10_Installe

安装步骤和安装服务器端是一样的这里就不详细描述]]></description>
			<content:encoded><![CDATA[<p>    之前有转载了一篇<a href="http://www.indang.net/yinyou/2008/92.html" target="_self">《rsync中文手册，使用rsync实现网站镜像和备份》</a>，介绍的是Linux下的安装配置，不过使用流程还是一样的。</p>
<p><strong>rsync的配置环境</strong><br />
软件平台:windows2003<br />
软件版本:cwRsync_2.0.10_Installer cwRsync_Server_2.0.10_Installer<br />
硬件平台:dell2950 cpu1.6G*4 内存:4G 硬盘:1G*6 RAID5</p>
<p><strong>===安装===</strong></p>
<p>在WINDOWS环境下安装rsync要安装服务端和客户端</p>
<p>服务器端安装:运行cwRsync_Server_2.0.10_Installer<br />
客户端安装:运行cwRsync _2.0.10_Installe</p>
<p>安装步骤和安装服务器端是一样的这里就不详细描述</p>
<p><strong>===配置===</strong><br />
配置和我们在linux下面的配置一样，在安装目录中找到rsync.conf文件进行配置:</p>
<p>Rsync.conf文件:</p>
<p>pid file = /var/run/rsyncd.pid</p>
<p>lock file = /var/run/rsync.lock</p>
<p>log file = /var/log/rsyncd.log</p>
<p>uid = administrator</p>
<p>gid = administrator</p>
<p>use chroot = no</p>
<p>max connections =4</p>
<p>syslog facility = local5</p>
<p>[test]</p>
<p>path =/cygdrive/d/wlk</p>
<p>comment=/cygdrive/d/wlk comment = BACKUP CLIENT IS SOLARIS 8 E250<br />
ignore errors # 可以忽略一些无关的IO错误<br />
read only = yes # 只读<br />
list = no # 不允许列文件<br />
auth users = inburst # 认证的用户名，如果没有这行，</p>
<p>则表明是匿名<br />
secrets file = etc/inburst.pas # 认证文件名</p>
<p>在server端生成一个密码文件etc/inburst.pas</p>
<p>打开记事本</p>
<p>inburst:hack</p>
<p>保存在安装路径下面的etc文件加下面文件明保存为inburst.pas</p>
<p>在服务中把RsyncServer启动，启动类型修改为自动这样服务器端就安装设置好了</p>
<p><strong>从client端进行测试</strong><br />
下面这个命令行中-vzrtopg里的v是verbose，z是压缩，r是recursive，topg都是保持文件原有属性如属主、时间的参数。–progress是指显示</p>
<p>出详细的进度情况，–delete是指如果服务器端删除了这一文件，那么客户端也相应把文件删除，保持真正的一致。<br />
后面的<a href="mailto:inburst@ip">inburst@ip</a>中，</p>
<p>    inburst是指定密码文件中的用户名，之后的::inburst这一inburst是模块名，也就是在/etc/rsyncd.conf中自定义的名称。最后的/tmp是备份到本地的目录名。<br />
    在这里面，还可以用-e ssh的参数建立起加密的连接。可以用–password-file=/password/path/file来指定密码文件，这样就可以在脚本中使用而无需交互式地输入验证密码了，这里需要注意的是这份密码文件权限属性要设得只有属主可读。</p>
<p>在客户端运行CMD</p>
<p>rsync -av 10.0.0.16::401 /cygdrive/h/401</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/654/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rsync同步服务器 windows下的架设</title>
		<link>http://blog.haohtml.com/index.php/archives/650</link>
		<comments>http://blog.haohtml.com/index.php/archives/650#comments</comments>
		<pubDate>Sat, 29 Nov 2008 00:54:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[数据备份]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=650</guid>
		<description><![CDATA[sync是linux下优秀的服务器同步备份软件，是个开源项目，用起来感觉非常的好，现在也有很多服务器是windows的，好在rsync也有windows下的版本，否则很多人将无法享受这么好的软件了。

下面讲下windows下rsync的架设步骤。

rsync特性简介

rsync是类unix系统下的数据镜像备份工具，从软件的命名上就可以看出来了——remote sync。它的特性如下：

1、可以镜像保存整个目录树和文件系统。
2、可以很容易做到保持原来文件的权限、时间、软硬链接等等。
3、无须特殊权限即可安装。
4、优化的流程，文件传输效率高。
5、可以使用rcp、ssh等方式来传输文件，当然也可以通过直接的socket连接。
6、支持匿名传输。
2. 安装]]></description>
			<content:encoded><![CDATA[<p>sync是linux下优秀的服务器同步备份软件，是个开源项目，用起来感觉非常的好，现在也有很多服务器是windows的，好在rsync也有windows下的版本，否则很多人将无法享受这么好的软件了。</p>
<p>下面讲下windows下rsync的架设步骤。</p>
<p><strong>rsync特性简介</strong></p>
<p>rsync是类unix系统下的数据镜像备份工具，从软件的命名上就可以看出来了——remote sync。它的特性如下：</p>
<p>1、可以镜像保存整个目录树和文件系统。<br />
2、可以很容易做到保持原来文件的权限、时间、软硬链接等等。<br />
3、无须特殊权限即可安装。<br />
4、优化的流程，文件传输效率高。<br />
5、可以使用rcp、ssh等方式来传输文件，当然也可以通过直接的socket连接。<br />
6、支持匿名传输。<br />
2. 安装<br />
<strong>rsync的配置环境<br />
</strong>软件平台：windows2003<br />
软件版本：cwRsync_2.0.10_Installer cwRsync_Server_2.0.10_Installer<br />
硬件平台：dell2950 cpu1.6G*4 内存:4G 硬盘：1G*6 RAID5</p>
<p>2． 安装</p>
<p>在WINDOWS环境下安装rsync要安装服务端和客户端</p>
<p>服务器端安装:运行cwRsync_Server_2.0.10_Installer<br />
客户端安装:运行cwRsync _2.0.10_Installe</p>
<p>安装步骤和安装服务器端是一样的这里就不详细描述</p>
<p><strong>3. 配置</strong><br />
配置和我们在linux下面的配置一样，在安装目录中找到rsync.conf文件进行配置：</p>
<p>Rsync.conf文件：</p>
<p>pid file = /var/run/rsyncd.pid</p>
<p>lock file = /var/run/rsync.lock</p>
<p>log file = /var/log/rsyncd.log</p>
<p>uid = administrator</p>
<p>gid = administrator</p>
<p>use chroot = no</p>
<p>max connections =4</p>
<p>syslog facility = local5</p>
<p>[test]</p>
<p>path =/cygdrive/d/wlk</p>
<p>comment=/cygdrive/d/wlk comment = BACKUP CLIENT IS SOLARIS 8 E250<br />
ignore errors # 可以忽略一些无关的IO错误<br />
read only = yes # 只读<br />
list = no # 不允许列文件<br />
auth users = inburst # 认证的用户名，如果没有这行，</p>
<p>则表明是匿名<br />
secrets file = etc/inburst.pas # 认证文件名</p>
<p>在server端生成一个密码文件etc/inburst.pas</p>
<p>打开记事本</p>
<p>inburst:hack</p>
<p>保存在安装路径下面的etc文件加下面文件明保存为inburst.pas</p>
<p>在服务中把RsyncServer启动，启动类型修改为自动<br />
这样服务器端就安装设置好了</p>
<p><strong>从client端进行测试</strong><br />
下面这个命令行中-vzrtopg里的v是verbose，z是压缩，r是recursive，topg都是保持文件原有属性如属主、时间<br />
的参数。&#8211;progress是指显示</p>
<p>出详细的进度情况，&#8211;delete是指如果服务器端删除了这一文件，那么客户端也相应把文件删除，保持真正的一致。<br />
后面的<a href="mailto:inburst@ip">inburst@ip</a>中，</p>
<p>inburst是指定密码文件中的用户名，之后的::inburst这一inburst是模块名，也就是在/etc/rsyncd.conf中自定义<br />
的名称。最后的/tmp是备份<br />
到本地的目录名。<br />
在这里面，还可以用-e ssh的参数建立起加密的连接。可以用&#8211;password-file=/password/path/file来指定密码文<br />
件，这样就可以在脚本中使</p>
<p>用而无需交互式地输入验证密码了，这里需要注意的是这份密码文件权限属性要设得只有属主可读。</p>
<p>在客户端运行CMD</p>
<p>rsync -av 10.0.0.16::401 /cygdrive/h/401</p>
<p><strong>常见问题:</strong><br />
Q：如何通过ssh进行rsync，而且无须输入密码？<br />
A：可以通过以下几个步骤<br />
1. 通过ssh-keygen在server A上建立SSH keys，不要指定密码，你会在~/.ssh下看到identity和identity.pub文件<br />
2. 在server B上的home目录建立子目录.ssh<br />
3. 将A的identity.pub拷贝到server B上<br />
4. 将identity.pub加到~[user b]/.ssh/authorized_keys<br />
5. 于是server A上的A用户，可通过下面命令以用户B ssh到server B上了<br />
e.g. ssh -l userB serverB<br />
这样就使server A上的用户A就可以ssh以用户B的身份无需密码登陆到server B上了。<br />
Q：如何通过在不危害安全的情况下通过防火墙使用rsync?<br />
A：解答如下：<br />
这通常有两种情况，一种是服务器在防火墙内，一种是服务器在防火墙外。<br />
无论哪种情况，通常还是使用ssh，这时最好新建一个备份用户，并且配置sshd仅允许这个用户通过RSA认证方式进入。<br />
如果服务器在防火墙内，则最好限定客户端的IP地址，拒绝其它所有连接。<br />
如果客户机在防火墙内，则可以简单允许防火墙打开TCP端口22的ssh外发连接就ok了。<br />
Q：我能将更改过或者删除的文件也备份上来吗？<br />
A：当然可以：<br />
你可以使用如：rsync -other -options -backupdir = ./backup-2000-2-13 &#8230;这样的命令来实现。<br />
这样如果源文件:/path/to/some/file.c改变了，那么旧的文件就会被移到./backup-2000-2-13/path/to/some/file.c，<br />
这里这个目录需要自己<br />
手工建立起来<br />
Q：我需要在防火墙上开放哪些端口以适应rsync？<br />
A：视情况而定<br />
rsync可以直接通过873端口的tcp连接传文件，也可以通过22端口的ssh来进行文件传递，但你也可以通过下列命令改变它的端口：<br />
rsync &#8211;port 8730 otherhost:: 或者 rsync -e &#8216;ssh -p 2002&#8242; otherhost:<br />
Q：我如何通过rsync只复制目录结构，忽略掉文件呢？<br />
A：rsync -av &#8211;include &#8216;*/&#8217; &#8211;exclude &#8216;*&#8217; source-dir dest-dir<br />
Q：为什么我总会出现&#8221;Read-only file system&#8221;的错误呢？<br />
A：看看是否忘了设&#8221;read only = no&#8221;了<br />
Q：为什么我会出现<a href="mailto:'@ERROR">&#8216;@ERROR</a>: invalid gid&#8217;的错误呢？<br />
A：rsync使用时默认是用uid=nobody;gid=nobody来运行的，如果你的系统不存在nobody组的话，就会出现这样的错误，可以试试gid = nogroup或者其它<br />
Q：绑定端口873失败是怎么回事？<br />
A：如果你不是以root权限运行这一守护进程的话，因为1024端口以下是特权端口，会出现这样的错误。你可以用&#8211;port参数来改变。<br />
Q：为什么我认证失败？<br />
A：从你的命令行看来：<br />
你用的是：<br />
&gt; bash$ rsync -a 144.16.251.213::test test<br />
&gt; Password:<br />
&gt; @ERROR: auth failed on module test<br />
&gt; I dont understand this. Can somebody explain as to how to acomplish this.<br />
&gt; All suggestions are welcome.<br />
应该是没有以你的用户名登陆导致的问题，试试rsync -a <a href="mailto:max@144.16.251.213::test">max@144.16.251.213::test</a> test</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/650/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用Rsync从Linux到Windows远程备份</title>
		<link>http://blog.haohtml.com/index.php/archives/644</link>
		<comments>http://blog.haohtml.com/index.php/archives/644#comments</comments>
		<pubDate>Sat, 29 Nov 2008 00:49:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[远程备份]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=644</guid>
		<description><![CDATA[rsync是Linux系统下的数据镜像备份工具，从软件的命名上就可以看出来了——remote sync。rsync支持大多数的类Unix系统，无论是Linux、Solaris还是BSD上都经过了良好的测试。rsync的最新版本可以从http://rsync.samba.org/rsync/获得。它的特性如下：
1、可以镜像保存整个目录树和文件系统。
2、可以很容易做到保持原来文件的权限、时间、软硬链接等等。
3、无须特殊权限即可安装。
4、优化的流程，文件传输效率高。
5、可以使用rcp、ssh等方式来传输文件，当然也可以通过直接的socket连接。
本文介绍了如何使用rsync服务从Linux到Windows进行远程备份。
一、配置服务器端
首先我们需要配置rsync，打开配置文件/etc/xinetd.d/rsyncd.conf（如果没有请创建它），修改相应的配置项，并增加以下内容：
uid = nobody # 备份以什么身份进行，用户ID
gid = nobody # 备份以什么身份进行，组ID
#注意这个用户ID和组ID，如果要方便的话，可以设置成root，这样rsync几乎就可#以读取任何文件和目录了，但是也带来安全隐患。建议设置成只能读取你要备
#份的目录和文件即可。]]></description>
			<content:encoded><![CDATA[<p>rsync是Linux系统下的数据镜像备份工具，从软件的命名上就可以看出来了——remote sync。rsync支持大多数的类Unix系统，无论是Linux、Solaris还是BSD上都经过了良好的测试。rsync的最新版本可以从http://rsync.samba.org/rsync/获得。它的特性如下：<br />
1、可以镜像保存整个目录树和文件系统。<br />
2、可以很容易做到保持原来文件的权限、时间、软硬链接等等。<br />
3、无须特殊权限即可安装。<br />
4、优化的流程，文件传输效率高。<br />
5、可以使用rcp、ssh等方式来传输文件，当然也可以通过直接的socket连接。<br />
本文介绍了如何使用rsync服务从Linux到Windows进行远程备份。<br />
一、配置服务器端<br />
首先我们需要配置rsync，打开配置文件/etc/xinetd.d/rsyncd.conf（如果没有请创建它），修改相应的配置项，并增加以下内容：<br />
uid = nobody # 备份以什么身份进行，用户ID<br />
gid = nobody # 备份以什么身份进行，组ID<br />
#注意这个用户ID和组ID，如果要方便的话，可以设置成root，这样rsync几乎就可#以读取任何文件和目录了，但是也带来安全隐患。建议设置成只能读取你要备<br />
#份的目录和文件即可。<br />
max connections = 4　# 最大连接数为4<br />
[www] # 指定认证的备份模块名<br />
path = /www # 需要备份的目录<br />
comment = BACKUP WWW　 # 注释<br />
ignore errors　# 忽略一些无关的IO错误<br />
read only = yes　# 设置为只读<br />
list = no # 不允许列文件<br />
auth users = wwwuser　 # 认证的用户名，如果没有这行，则表明是匿名<br />
hosts allow=220.122.133.31　 #允许连接服务器的主机IP地址<br />
secrets file = /etc/wwwuser.pass # 认证文件名，用来存放密码<br />
这一段我们修改完成。<br />
注意：如果同时还需要备份其它目录的话，可以直接在配置文件的后面继续增加配置内容，例如：<br />
[database]<br />
path = /var/lib/mysql<br />
……<br />
这样就可以同时备份多个目录了。<br />
然后为备份模块设置密码文件，如上例的密码文件为/etc/wwwuser.pass，使用编辑器创建这个文件，并输入用户名称和密码：<br />
vi /etc/wwwuser.pass<br />
输入以下内容：<br />
wwwuser:123456<br />
这样，为备份模块www的用户wwwuser设置了密码123456。注意，出于安全目的，这个文件的属性必需是只有属主可读，否则rsync将拒绝运行。我们可以设置它的属性为600：<br />
chmod 600 /etc/wwwuser.pass<br />
设置rsync服务在系统启动时自动启动运行，可以通过ntsysv来设置：</p>
<p><a href="http://blog.haohtml.com/wp-content/uploads/2008/11/20080807180632876.jpg"><img class="alignnone size-medium wp-image-645" title="20080807180632876" src="http://blog.haohtml.com/wp-content/uploads/2008/11/20080807180632876-282x300.jpg" alt="" width="282" height="300" /></a></p>
<p>最后在服务器端我们需要启动rsync服务：<br />
service xinetd restart<br />
至此，服务器端配置完毕。<br />
<span id="more-644"></span></p>
<p>二、配置客户端<br />
为了在Windows环境使用rsync工具，我们需要去下载cwRsync工具，这是一个rsync for windows的版本。<br />
下载安装完成之后的目录结构类似下图所示：</p>
<p><a href="http://blog.haohtml.com/wp-content/uploads/2008/11/a1.jpg"><img class="alignnone size-medium wp-image-646" title="用Rsync从Linux到Windows远程备份" src="http://blog.haohtml.com/wp-content/uploads/2008/11/a1-300x267.jpg" alt="" width="300" height="267" /></a></p>
<p>现在我们可以在Windows环境下运行rsync工具了，举例使用下面的命令连接服务器并开始备份目录和文件：</p>
<table border="1" cellspacing="0" cellpadding="2" width="400" align="center">
<tbody>
<tr>
<td class="code" bgcolor="#e6e6e6">
<pre>rsync -vzrtopg --progress --delete wwwuser@xx.xx.xx.xx::www .\bak</pre>
</td>
</tr>
</tbody>
</table>
<p>应该可以看到：<br />
password:<br />
要求输入密码的提示，正确输入密码后就应该看到开始备份了。当然，也有可能出现类似下面的错误信息：</p>
<p>应该可以看到：<br />
password:<br />
要求输入密码的提示，正确输入密码后就应该看到开始备份了。当然，也有可能出现类似下面的错误信息：</p>
<p align="center"><a href="http://blog.haohtml.com/wp-content/uploads/2008/11/b1.jpg"><img class="alignnone size-medium wp-image-647" title="用Rsync从Linux到Windows远程备份" src="http://blog.haohtml.com/wp-content/uploads/2008/11/b1-300x82.jpg" alt="" width="534" height="153" /></a></p>
<p>引起这种错误有几种可能性，一是你没有输入正确的用户名或密码，二是你的服务器端存储密码的文件没有正确的权限，也就是你的密码文件不是类似这样子的权限：-rw&#8212;&#8212;-1 root root<br />
在备份完成之后，我们可以看到类似下图所示的状态：</p>
<p>　</p>
<p align="center"><a href="http://blog.haohtml.com/wp-content/uploads/2008/11/c.jpg"><img class="alignnone size-full wp-image-648" title="用Rsync从Linux到Windows远程备份" src="http://blog.haohtml.com/wp-content/uploads/2008/11/c.jpg" alt="" width="499" height="237" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/644/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rsync在windows与windows服务器之间的同步设置</title>
		<link>http://blog.haohtml.com/index.php/archives/642</link>
		<comments>http://blog.haohtml.com/index.php/archives/642#comments</comments>
		<pubDate>Sat, 29 Nov 2008 00:40:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[服务器类]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[同步]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=642</guid>
		<description><![CDATA[一、windows与windows同步
1.准备两台机器：
server-----192.168.0.201
client-----192.168.0.202

2.下载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.zip
client端：cwRsync_2.0.10_Installer.zip]]></description>
			<content:encoded><![CDATA[<div><span class="Apple-style-span" style="word-spacing: 0px; font: bold 13px/16px Verdana; text-transform: none; color: #333333; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0;"><span class="Apple-style-span" style="word-spacing: 0px; font: 13px/23px Verdana; text-transform: none; color: #595959; text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0;"></p>
<p style="color: #595959; line-height: 180%;">一、windows与windows同步<br style="line-height: 180%;" />1.准备两台机器：<br style="line-height: 180%;" />server&#8212;&#8211;192.168.0.201<br style="line-height: 180%;" />client&#8212;&#8211;192.168.0.202<br style="line-height: 180%;" /><br style="line-height: 180%;" />2.下载windows版的rsync工具<br style="line-height: 180%;" />具体软件下载链接我也忘了，不过在google应该可以搜索到。<br style="line-height: 180%;" />我也将它上传到CU上……<br style="line-height: 180%;" /></p>
<table style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #595959; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0" align="center">
<tbody style="line-height: 180%;">
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center"><img style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" src="http://blog.chinaunix.net/fileicon/zip.gif" border="0" alt="" /></td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">
<table style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #595959; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0">
<tbody style="line-height: 180%;">
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">文件:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">cwRsync_2.0.10_Installer.zip</td>
</tr>
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">大小:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">2953KB</td>
</tr>
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">下载:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;"><a style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #333333; text-decoration: underline;" href="http://blogimg.chinaunix.net/blog/upfile/070917224721.zip">下载</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #595959; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0" align="center">
<tbody style="line-height: 180%;">
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center"><img style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" src="http://blog.chinaunix.net/fileicon/zip.gif" border="0" alt="" /></td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">
<table style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #595959; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0">
<tbody style="line-height: 180%;">
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">文件:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">cwRsync_Server_2.0.10_Installer.zip</td>
</tr>
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">大小:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;">2821KB</td>
</tr>
<tr style="line-height: 180%;">
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;" align="center">下载:</td>
<td style="margin: 0px auto; line-height: 180%; border-width: 0px; padding: 0px;"><a style="font: 12px/180% Verdana, Arial, Helvetica, 宋体, sans-serif; color: #333333; text-decoration: underline;" href="http://blogimg.chinaunix.net/blog/upfile/070917224837.zip">下载</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>server端：cwRsync_Server_2.0.10_Installer.zip<br style="line-height: 180%;" />client端：cwRsync_2.0.10_Installer.zip<br style="line-height: 180%;" /><br style="line-height: 180%;" />3.安装 与配置<br style="line-height: 180%;" />SERVER：<br style="line-height: 180%;" />(1)安装cwRsync_Server_2.0.10_Installer.zip<br style="line-height: 180%;" />在开始程序中打开“start a unix bash shell”程序:<br style="line-height: 180%;" />进入一个类似cmd的终端,输入如下命令：<br style="line-height: 180%;" />＄/bin/activate-user.sh<br style="line-height: 180%;" />输入l<br style="line-height: 180%;" />输入administrator<br style="line-height: 180%;" />后面全按回来结束<br style="line-height: 180%;" /><br style="line-height: 180%;" />(2)启动opensshd<br style="line-height: 180%;" />打开“控制面板”－－＞“管理工具”－－＞“服务”：<br style="line-height: 180%;" />找到一个opensshd的服务，启动它<br style="line-height: 180%;" /><br style="line-height: 180%;" />(3)配置rsyncd.conf配置文件<br style="line-height: 180%;" />编辑C:\Program Files\cwRsyncServer\rsyncd.conf，内容如下：<br style="line-height: 180%;" />use chroot = false<br style="line-height: 180%;" />strict modes = false<br style="line-height: 180%;" />hosts allow = *<br style="line-height: 180%;" />log file = rsyncd.log<br style="line-height: 180%;" />pid file = rsyncd.pid<br style="line-height: 180%;" /># Module definitions<br style="line-height: 180%;" /># Remember cygwin naming conventions : c:\work becomes /cygwin/c/work<br style="line-height: 180%;" />[rsync]<span class="Apple-converted-space"> </span><br style="line-height: 180%;" />path = /cygdrive/f/rsync   (此处路径代表f:\rsync目录)<br style="line-height: 180%;" />read only = yes<br style="line-height: 180%;" />transfer logging = yes<br style="line-height: 180%;" />secrets file = /cygdrive/f/rsyncd.secrets<span class="Apple-converted-space"> </span><br style="line-height: 180%;" /><br style="line-height: 180%;" />(4)启动rsync服务<br style="line-height: 180%;" />打开“控制面板”－－＞“管理工具”－－＞“服务”：<br style="line-height: 180%;" />找到一个RsyncServer的服务，启动它<br style="line-height: 180%;" />到此server端配置结束，接下来配置client端 。<br style="line-height: 180%;" /><br style="line-height: 180%;" />CLIENT：<br style="line-height: 180%;" />(1)安装client端软件包：cwRsync_2.0.10_Installer.zip<br style="line-height: 180%;" />(2)打开cmd，执行如下操作，测试服务端是否正常 启动服务 了：<br style="line-height: 180%;" />cd C:\Program Files\cwRsync\bin<br style="line-height: 180%;" />telnet 192.168.0.201 22<br style="line-height: 180%;" />telnet 192.168.0.201 873<br style="line-height: 180%;" />若上述测试成功，此时可执行同步计划：<br style="line-height: 180%;" />rsync -vzrtopg &#8211;progress &#8211;delete 192.168.0.201::rsync /cygdrive/d/test<br style="line-height: 180%;" />或者是：<br style="line-height: 180%;" />rsync -vzrtopg &#8211;progress &#8211;delete 192.168.0.201：/cygdrive/d/rsync /cygdrive/d/test<br style="line-height: 180%;" />(此时，会提示输入密码，用户名为administrator，密码则为192.168.0.201的管理员登录密码)<br style="line-height: 180%;" />至此，安装配置windows到windows间的同步已经OK<br style="line-height: 180%;" />如果定时同步server上的文件，可将其加入任务计划中。<br style="line-height: 180%;" /><br style="line-height: 180%;" /><br style="line-height: 180%;" /><br style="line-height: 180%;" /><br style="line-height: 180%;" />二、windows作为server时与linux间的同步<br style="line-height: 180%;" />1、准备机器，此时使用windows作为server<br style="line-height: 180%;" />server&#8212;192.168.0.201 (windows)<br style="line-height: 180%;" />client&#8212;192.168.0.132 (linux)<br style="line-height: 180%;" /><br style="line-height: 180%;" />2、经过上文的操作，此时可简化操作了<br style="line-height: 180%;" />进入linux主机client同步server:<br style="line-height: 180%;" />#rsync -vzrtopg &#8211;progress &#8211;delete 192.168.0.201::rsync /test<span class="Apple-converted-space"> </span><br style="line-height: 180%;" /><br style="line-height: 180%;" /><br style="line-height: 180%;" /><br style="line-height: 180%;" />三、linux作为server时与windows间的同步<br style="line-height: 180%;" />1、准备机器，此时使用linux作为server<br style="line-height: 180%;" />server&#8212;192.168.0.132 (linux)<br style="line-height: 180%;" />client&#8212;192.168.0.202 (windows)<br style="line-height: 180%;" /><br style="line-height: 180%;" />2、安装与配置linux主机的rsync<br style="line-height: 180%;" />(1)查看linux上是否安装rsync:<br style="line-height: 180%;" />#rpm -qa|grep rsync<br style="line-height: 180%;" />若无则安装，或者使用tar编译安装<br style="line-height: 180%;" />#rpm -ivh rsync-2.6.8-3.1.rpm<br style="line-height: 180%;" /><br style="line-height: 180%;" />(2)打开rsync服务<br style="line-height: 180%;" />#chkconfig xinetd on<br style="line-height: 180%;" />#chkconfig rsync on<br style="line-height: 180%;" /><br style="line-height: 180%;" />(3)创建 rsyncd.conf 文件<br style="line-height: 180%;" />#touch /etc/rsyncd.conf<br style="line-height: 180%;" />#vi /etc/rsyncd.conf(内容如下：)<br style="line-height: 180%;" />uid = nobody<br style="line-height: 180%;" />gid = nobody<br style="line-height: 180%;" />max connections = 4<br style="line-height: 180%;" /><br style="line-height: 180%;" />[www]<br style="line-height: 180%;" />path = /www<br style="line-height: 180%;" />comment = BACKUP WWW<br style="line-height: 180%;" />ignore errors<br style="line-height: 180%;" />read only = yes<br style="line-height: 180%;" />list = no<br style="line-height: 180%;" />auth users = wwwuser<br style="line-height: 180%;" />hosts allow=192.168.0.202<br style="line-height: 180%;" />secrets file = /etc/wwwuser.pass<br style="line-height: 180%;" /><br style="line-height: 180%;" />(4)启动基于xinetd进程的rsync服务<br style="line-height: 180%;" />#/etc/init.d/xinetd start<br style="line-height: 180%;" /><br style="line-height: 180%;" />3、配置windows的rsync客户端<span class="Apple-converted-space"> </span><br style="line-height: 180%;" />(1)安装client端的rsync包<br style="line-height: 180%;" />(2)打开cmd,执行同步计划：<br style="line-height: 180%;" />cd C:\Program Files\cwRsync\bin<br style="line-height: 180%;" />rsync -vzrtopg &#8211;progress &#8211;delete root@192.168.0.132::www /cygdrive/d/test<br style="line-height: 180%;" />(此时须输入root用户的密码，就可进行同步了。)<br style="line-height: 180%;" /><br style="line-height: 180%;" />至此，全部配置完成。<br style="line-height: 180%;" /><br style="line-height: 180%;" />注：<br style="line-height: 180%;" />要使用加密的同步，可使用……<br style="line-height: 180%;" />rsync -e &#8216;ssh -p 2002&#8242; -vzrtopg &#8211;progress &#8211;delete root@192.168.0.132::www /cygdrive/d/test</span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/index.php/archives/642/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
