共享服務(wù)器同步數(shù)據(jù)

1.下載客戶(hù)端和服務(wù)端的安裝包

下載服務(wù)端安裝文件http://www.jb51.net/softs/55933.html
下載客戶(hù)端安裝文件http://www.jb51.net/softs/55934.html

2,在共享服務(wù)器端安裝服務(wù)端

默認(rèn)一直下一步,到下圖所示

在此處更改rsync要?jiǎng)?chuàng)建的系統(tǒng)用戶(hù)及用戶(hù)名,其他采用默認(rèn)選項(xiàng)安裝。安裝后,服務(wù)默認(rèn)為手動(dòng)啟動(dòng)模式,到“管理工具/服務(wù)管理”里,啟動(dòng)“RsyncServer”服務(wù),并修改“RsyncServer”為自動(dòng)啟動(dòng)模式。如下:

3.服務(wù)器端配置(windows系統(tǒng))

編輯cwRsync安裝目錄下的rsyncd.conf文件,寫(xiě)入如下信息:

port = 22? ? ? ? ? ? ? ? # rsync服務(wù)的端口(873是默認(rèn)端口,你可以更改,需要確保此端口可以被client端訪問(wèn))
use chroot = false? ? ? ? # 默認(rèn),不更改
strict modes = false? ? # 默認(rèn),不更改
hosts allow = 192.168.1.110,192.168.1.105 # 允許連接服務(wù)器的客戶(hù)端的IP地址列表(*表示不限制)
max connections = 10? # 最大連接數(shù)
log file = rsyncd.log? ? ? ? # 日志文件
pid file = rsyncd.pid? # 運(yùn)行進(jìn)程的ID寫(xiě)到哪里
uid=0? ? ? ? ? ? ? ? ? ? ? ? # 對(duì)某些場(chǎng)合,這個(gè)很重要,下面再解釋
gid=0? ? ? ? ? ? ? ? ? ? ? ? # 對(duì)某些場(chǎng)合,這個(gè)很重要,下面再解釋
auth users = zys? ? ? ? # 允許連接服務(wù)器的用戶(hù)名
secrets file = rsyncd.pas? ? # 允許連接服務(wù)器的帳戶(hù)文件,其格式在下面會(huì)詳述
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#
[test]? ? ? ? ? ? # 一個(gè)模塊的名字,可隨意起,但最好有意義
path = /cygdrive/c/test? # 同步的目錄的路徑,其中,c盤(pán)就是“/cygdrive/c”,所以該路徑指的是c盤(pán)下的test目錄
read only = false
transfer logging = yes? # 傳輸時(shí)記錄日志
[test2]
path = /cygdrive/E/Documents and Settings/another
read only = false
transfer logging = yes? # 傳輸時(shí)記錄日志

其中[test]和[test2]是設(shè)置的要同步的數(shù)據(jù)的模塊,path是磁盤(pán)路徑,/cygdrive/c/test對(duì)應(yīng)到c:\test文件夾,由于cwRsync軟件在windows下不能夠直接掛盤(pán)符,采用 /cygdrive/這種模式。

需要注意的幾點(diǎn):

1)你設(shè)置的rsync服務(wù)器端口必須在防火墻里打開(kāi),否則客戶(hù)端還是連接不上。
2)rsyncd.conf文件中的模塊([test])上方是公用的參數(shù),也就是所有模塊都會(huì)共享的參數(shù),如果在該模塊內(nèi)部又為該參數(shù)設(shè)置了不同的值,則會(huì)按模塊內(nèi)部的值來(lái)算。
3)rsyncd.pas文件的內(nèi)容格式如下:
用戶(hù)名:密碼
例如:

zys:123456

4)一般來(lái)說(shuō),你要同步一個(gè)目錄的話,就要在rsyncd.conf中添加一個(gè)“模塊”,并為該模塊設(shè)置路徑等參數(shù)。
5)如果客戶(hù)端連接rsync服務(wù)器時(shí),提示chdir失敗,并且你的登錄用戶(hù)名和密碼之類(lèi)的都設(shè)置對(duì)了,那么很可能你就需要添加上面的“uid=0”和“gid=0”了
6)如果出現(xiàn)rsync: failed to open lock file 錯(cuò)誤,則在rsync.conf中填加一行:
? ? ? ? ? lock file = rsyncd.lock
好了,服務(wù)器端的設(shè)置基本完成,然后啟動(dòng)rsync服務(wù),就可以了。
下面我們來(lái)進(jìn)行客戶(hù)端的工作,以完成同步任務(wù)。


4.客戶(hù)端安裝(windows)

在cwRsync安裝目錄下的bin/目錄下創(chuàng)建dnt_rsync.bat,編輯寫(xiě)入如下內(nèi)容:

set CYGWIN=nontsec
rsync -ravztopg –progress –delete –password-
file=/cygdrive/c/rsycnd.pas rsync://zys@192.168.1.111:22/test? /cygdrive/c/test
rsync-ravztopg –progress –delete –password-
file=/cygdrive/c/rsycnd.pas rsync://zys@192.168.1.111:22/test2? /cygdrive/c/test2

運(yùn)行客戶(hù)端的dnt_rsync.bat文件,就可以將服務(wù)器端的數(shù)據(jù)同步到客戶(hù)端。

說(shuō)明:

1) set CYGWIN=nontsec 這個(gè)參數(shù)十分重要,不然會(huì)引起文件權(quán)限問(wèn)題
2) –delete 是否刪除的選項(xiàng),比如服務(wù)器端刪除了一個(gè)文件,客戶(hù)端如果也要?jiǎng)h除,就要加上這個(gè)參數(shù),小心使用
3) 192.168.1.100是rsync服務(wù)器IP,請(qǐng)視實(shí)際情況更改。
4) –password-file 參數(shù)指定了客戶(hù)端登錄服務(wù)器時(shí),使用的帳戶(hù)的密碼文件,例如上面的“/cygdrive/c/rsycnd.pas” 表明是 c:\rsycnd.pas 文件,該文件內(nèi)容就是登錄rsync服務(wù)器的帳戶(hù)的密碼。
5) rsync://zys@192.168.1.111:22/test和rsync://zys@192.168.1.111:22/test2中的test和test2,指定的是rsync服務(wù)器配置文件中設(shè)置的模塊名,必須一致。
6) 有多個(gè)目錄要同步,就寫(xiě)多個(gè)rsync命令,雙擊此批處理文件時(shí),會(huì)依次執(zhí)行。
7) 上面例子中的第一個(gè)rsync命令的含義是:將遠(yuǎn)程的rsync服務(wù)器中,test模塊所指定的目錄,同步到本地的 c/test 目錄。在客戶(hù)端,如果路徑中含有空格,則需要將路徑用雙引號(hào)括起來(lái)。

這樣配置好之后,雙擊批處理文件,你的兩個(gè)目錄就開(kāi)始同步啦,rsync會(huì)自動(dòng)判斷哪些文件修改了,哪些沒(méi)有修改,只傳輸修改過(guò)的文件(并且還會(huì)增量傳輸),節(jié)省你的帶寬,極其高效。

rsync功能非一般強(qiáng)大,關(guān)于rsync的更多配置選項(xiàng),此處絕對(duì)不可能描述得完,請(qǐng)參考其手冊(cè)。


5.計(jì)劃任務(wù)(windows)

首先在客戶(hù)端的機(jī)器上的: 控件面板->任務(wù)計(jì)劃->點(diǎn)擊“添加任務(wù)計(jì)劃”, 在相應(yīng)的彈出窗口中點(diǎn)擊下一步,然后點(diǎn)擊導(dǎo)航窗口中的“瀏覽”按鈕,如下,并從中選擇之前創(chuàng)建的批處理文件”dnt_sync.bat”:

這時(shí)系統(tǒng)會(huì)顯示如下窗口提示當(dāng)前計(jì)劃任務(wù)執(zhí)行方式,我這里選擇每天執(zhí)行(一次):
到這里,系統(tǒng)就會(huì)創(chuàng)建一個(gè)叫dnt_sync的任務(wù)計(jì)劃,同時(shí)在接下來(lái)的窗口中提示任務(wù)的開(kāi)始執(zhí)行時(shí)間:
這里不做任何修改,直接點(diǎn)擊下一步,接著是身份驗(yàn)證(通常是管理員身份),必定任務(wù)計(jì)劃非同兒戲,要有足夠的權(quán)限才可以
最后點(diǎn)擊完成,就創(chuàng)建了一個(gè)任務(wù)計(jì)劃。只不過(guò)它是按天執(zhí)行的,如果我們希望其每分鐘執(zhí)行一次又該怎么辦呢,其實(shí)很簡(jiǎn)單,只要在用鼠標(biāo)點(diǎn)擊新創(chuàng)建的任務(wù)計(jì)劃,并在彈出菜單中選擇“屬性”,這時(shí)在彈出窗口的“日程安排”中點(diǎn)擊“高級(jí)按鈕”,如下:
這時(shí)就會(huì)彈出一個(gè)叫“高級(jí)計(jì)劃選項(xiàng)”的子窗口,在其它做如下設(shè)置:
到這里,這個(gè)計(jì)劃任務(wù)就會(huì)每天24小時(shí),以每分鐘運(yùn)行一次的方式來(lái)同步之前的那兩個(gè)文件夾了



1? Linux版安裝配置

1.1 客戶(hù)端安裝及配置(linux)

1?下載地址:http://rsync.samba.org/ftp/rsync/rsync-3.0.7.tar.gz

2?下載安裝包:wgethttp://rsync.samba.org/ftp/rsync/rsync-3.0.7.tar.gz

3?解壓縮:tar–zxvf?rsync-3.0.7.tar.gz

4?進(jìn)入目錄?cd?rsync-3.0.7

5?安裝rsync:

./configure?–prefix=/usr/local/rsync

make

make?install

執(zhí)行同步命令:rsync?-ravztopg?–progress?–delete?–password-file=/usr/local/rsync/bin/rsycnd.pas?rsync://zys@192.168.1.111:873/test2??/usr/local/rsync/test2

同步成功,不做過(guò)多解釋了。

1.2?服務(wù)端安裝(linux)

同客戶(hù)端安裝。

1.3?服務(wù)端配置(linux)

1.3.1?編輯配置文件rsyncd.conf

1)?新建配置文件

touch?/etc/rsyncd.conf

2)?編輯內(nèi)容

vim?/etc/rsyncd.conf

usechroot?=?false

strict?modes?=?false

port?=?873

hosts?allow?=?192.168.4.148,60.18.147.50,222.33.192.62

log?file?=?/home/rsync/rsyncd.log

pid?file?=/home/rsync/rsyncd.pid

uid?=?nobody

gid?=?nobody

#?Module?definitions

#?Remember?cygwin?naming?conventions?:?c:\work?becomes?/cygwin/c/work

#

[test2]

auth?users?=?rsyimg

secrets?file?=?/home/rsync/rsyncd.pas

path?=?/home/img

read?only?=?false

transfer?logging?=?yes

3)?保存退出

1.3.2?生成驗(yàn)證文件rsyncd.pas

1)?生成驗(yàn)證文件echo?“rsync:rsync”?>?/home/rsync/rsyncd.pas??(rsync:rsync為用戶(hù)和密碼,格式為user:passwd)

2)?修改文件屬主chown??root:root??/home/rsync/rsyncd.pas

3)?修改文件權(quán)限chmod?600??/home/rsync/rsyncd.pas

1.3.3?啟動(dòng)rsync服務(wù)

/usr/local/rsync/bin/rsync?–daemon

修改了rsyncd.conf文件,則要重新啟動(dòng)rsync服務(wù)。

Ps:

啟動(dòng)時(shí)報(bào)錯(cuò):

/usr/local/rsync/bin/rsync:?error?while?loading?shared?libraries:?libiconv.so.2:?cannot?open?shared?object?file:?No?such?file?or?directory

解決方案

1、編輯/etc/ld.so.conf文件,添加一行:

/usr/local/lib

2、保存后運(yùn)行l(wèi)dconfig。

3、再啟動(dòng)運(yùn)行rsyncd服務(wù)運(yùn)行,問(wèn)題得到解決。

(注:ld.so.conf和ldconfig用于維護(hù)系統(tǒng)動(dòng)態(tài)鏈接庫(kù))

1.4?計(jì)劃任務(wù)(linux)

*/5?*?*?*?*??/usr/local/rsync/rsync-ravztopg?–progress?–delete?–chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=rx–password-file=/usr/local/rsync/bin/rsycnd.pas?rsync://zys@192.168.1.111:873/test2??/usr/local/rsync/test2

注:

1、每5分鐘執(zhí)行一次

2、–chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=rx修改通過(guò)到客戶(hù)端文件及文件夾的權(quán)限,D代表文件夾,F(xiàn)代表文件,u代表?yè)碛姓?,g代表用戶(hù)組,o代表其他用戶(hù),r、w、x分別為讀、寫(xiě)、執(zhí)行

3、?rsycnd.pas?文件,該文件內(nèi)容就是登錄rsync服務(wù)器的帳戶(hù)的密碼。

4、?rsync://zys@192.168.1.111:873/test2中的test2,指定的是rsync服務(wù)器配置文件中設(shè)置的模塊名,必須一致。

2?參考

2.1?windows?2003?server?使用cwrsync同步文件夾的權(quán)限問(wèn)題

http://hi.baidu.com/gaodi2002/blog/item/f6ad56eeac529bf7b2fb95e3.html

windows?2003?server?使用cwrsync同步文件夾的權(quán)限問(wèn)題

windows?2003?server?使用cwrsync?3?同步文件夾后,權(quán)限和安全屬性不能同步,直接導(dǎo)致無(wú)法使用,查閱資料后發(fā)現(xiàn)必須在運(yùn)行命令前使用SET?CYGWIN=nontsec參數(shù)

將以下內(nèi)容保存成.bat批處理文件后即可運(yùn)行。

@ECHO?OFF

SET?CYGWIN=nontsec

“c:\Program?Files\cwRsync\bin\rsync”?-avrr?/cygdrive/c/srcdir/?/cygdrive/d/dstdir/

對(duì)于cwrsync?3.0.7以后及cwrsync?4.0以后的版本,?由于cygwin已經(jīng)從1.5升級(jí)到1.7,而且cygwin1.7的mount點(diǎn)從注冊(cè)表改成了/etc/fstab?,cwrsync?4.0.4版本使用CYGWIN=nontsec參數(shù)無(wú)效,仍然存在目錄權(quán)限問(wèn)題,解決方法如下,在rsync.exe的上一級(jí)目錄新建一個(gè)etc目錄,?然后在etc目錄用寫(xiě)字板新建一個(gè)fstab文件,不帶擴(kuò)展名,文件內(nèi)容為

#edit?by?gaodi

#none?/cygdrivecygdriventfsoverride,binary,noacl?0?0

none?/cygdrivecygdrivebinary,posix=0,user,noacl?0?0

C:/Program\040Files/cwrsync?/?ntfsoverride,binary,noacl?0?0

C:/Program\040Files/cwrsync/bin?/usr/bin?ntfsoverride,binary,noacl?0?0

#C:/Program\040Files/cwrsync/etc/terminfo?/usr/share/terminfontfsoverride,binary,noacl?0?0

保存退出。

重新運(yùn)行rsync.exe?執(zhí)行同步后目錄就不會(huì)出現(xiàn)”權(quán)限順序不正確”的提示了。

(主要是第三行起作用,如果只加這一行一定要在最后加一個(gè)回車(chē)符)

附fstab文件的使用方法:

The?Cygwin?Mount?Table

The?/etc/fstab?file?is?used?to?map?Win32?drives?and?network?shares?into?Cygwin’s?internal?POSIX?directory?tree.?This?is?a?similar?concept?to?the?typical?UNIX?fstab?file.?The?mount?points?stored?in?/etc/fstab?are?globally?set?for?all?users.?Sometimes?there’s?a?requirement?to?have?user?specific?mount?points.?The?Cygwin?DLL?supports?user?specific?fstab?files.?These?are?stored?in?the?#?#directory?/etc/fstab.d?and?the?name?of?the?file?is?the?Cygwin?username?of?the?user,?as?it’s?stored?in?the?/etc/passwd?file.?The?content?of?the?user?specifc?file?is?identical?to?the?system-wide?fstab?file.

The?file?fstab?contains?descriptive?information?about?the?various?file?systems.?fstab?is?only?read?by?programs,?and?not?written;?it?is?the?duty?of?the?system?administrator?to?properly?create?and?maintain?this?file.?Each?filesystem?is?described?on?a?separate?line;?fields?on?each?line?are?separated?by?tabs?or?spaces.?Lines?starting?with?‘#’?are?comments.

The?first?field?describes?the?block?special?device?or?remote?filesystem?to?be?mounted.?On?Cygwin,?this?is?the?native?Windows?path?which?the?mount?point?links?in.?As?path?separator?you?MUST?use?a?slash.?Usage?of?a?backslash?might?lead?to?unexpected?results.?UNC?paths?(using?slashes,?not?backslashes)?are?allowed.?If?the?path?contains?spaces?these?can?be?escaped?as?‘\040’.

The?second?field?describes?the?mount?point?for?the?filesystem.?If?the?name?of?the?mount?point?contains?spaces?these?can?be?escaped?as?‘\040’.

The?third?field?describes?the?type?of?the?filesystem.?Cygwin?supports?any?string?here,?since?the?file?system?type?is?usually?not?evaluated.?The?notable?exception?is?the?file?system?type?cygdrive.?This?type?is?used?to?set?the?cygdrive?prefix.

The?fourth?field?describes?the?mount?options?associated?with?the?filesystem.?It?is?formatted?as?a?comma?separated?list?of?options.?It?contains?at?least?the?type?of?mount?(binary?or?text)?plus?any?additional?options?appropriate?to?the?filesystem?type.?Recognized?options?are?binary,?text,?nouser,?user,?exec,?notexec,?cygexec,?nosuid,?posix=[0|1].?The?meaning?of?the?options?is?as?follows.

acl???????–?Cygwin?uses?the?filesystem’s?access?control?lists?(ACLs)?to

implement?real?POSIX?permissions?(default).?This?flag?only

affects?filesystems?supporting?ACLs?(NTFS)?and?is?ignored

otherwise.

auto??????–?Ignored.

binary????–?Files?default?to?binary?mode?(default).

cygexec???–?Treat?all?files?below?mount?point?as?cygwinexecutables.

exec??????–?Treat?all?files?below?mount?point?as?executable.

noacl?????–?Cygwin?ignores?filesystem?ACLs?and?only?fakes?a?subset?of

permission?bits?based?on?the?DOS?readonly?attribute.?This

behaviour?is?the?default?on?FAT?and?FAT32.?The?flag?is

ignored?on?NFS?filesystems.

nosuid????–?No?suid?files?are?allowed?(currently?unimplemented).

notexec???–?Treat?all?files?below?mount?point?as?not?executable.

nouser????–?Mount?is?a?system-wide?mount.

override?–?Force?the?override?of?an?immutable?mount?point?(currently?“/”).

posix=0???–?Switch?off?case?sensitivity?for?paths?under?this?mount?point.

posix=1???–?Switch?on?case?sensitivity?for?paths?under?this?mount?point

(default).

text??????–?Files?default?to?CRLF?text?mode?line?endings.

user??????–?Mount?is?a?user?mount.

While?normally?the?execute?permission?bits?are?used?to?evaluate?executability,?this?is?not?possible?on?filesystems?which?don’t?support?permissions?at?all?(like?FAT/FAT32),?or?if?ACLs?are?ignored?on?filesystems?supporting?them?(see?the?aforementioned?acl?mount?option).?In?these?cases,?the?following?heuristic?is?used?to?evaluate?if?a?file?is?executable:?Files?ending?in?certain?extensions?(.exe,?.com,?.bat,?.btm,?.cmd)?are?assumed?to?be?executable.?Files?whose?first?two?characters?begin?with?‘#!’?are?also?considered?to?be?executable.?The?exec?option?is?used?to?instruct?Cygwin?that?the?mounted?file?is?“executable”.?If?the?exec?option?is?used?with?a?directory?then?all?files?in?the?directory?are?executable.?This?option?allows?other?files?to?be?marked?as?executable?and?avoids?the?overhead?of?opening?each?file?to?check?for?a?‘#!’.?The?cygexec?option?is?very?similar?to?exec,?but?also?prevents?Cygwin?from?setting?up?commands?and?environment?variables?for?a?normal?Windows?program,?adding?another?small?performance?gain.?The?opposite?of?these?options?is?the?notexec?option,?which?means?that?no?files?should?be?marked?as?executable?under?that?mount?point.

A?correct?root?directory?is?quite?essential?to?the?operation?of?Cygwin.?A?default?root?directory?is?evaluated?at?startup?so?afstab?entry?for?the?root?directory?is?not?necessary.?If?it’s?wrong,?nothing?will?work?as?expected.?Therefore,?the?root?directory?evaluated?by?Cygwin?itself?is?treated?as?an?immutable?mount?point?and?can’t?be?overridden?in?/etc/fstab…?unless?you?think?you?really?know?what?you’re?doing.?In?this?case,?use?the?override?flag?in?the?options?field?in?the?/etc/fstab?file.?Since?this?is?a?dangerous?thing?to?do,?do?so?at?your?own?risk.

/usr/bin?and?/usr/lib?are?by?default?also?automatic?mount?points?generated?by?the?Cygwin?DLL?similar?to?the?way?the?root?directory?is?evaluated.?/usr/bin?points?to?the?directory?the?Cygwin?DLL?is?installed?in,?/usr/lib?is?supposed?to?point?to?the?/lib?directory.?This?choice?is?safe?and?usually?shouldn’t?be?changed.?An?fstab?entry?for?them?is?not?required.

nouser?mount?points?are?not?overridable?by?a?later?call?to?mount.?Mount?points?given?in?/etc/fstab?are?by?default?nouser?mount?points,?unless?you?specify?the?option?user.?This?allows?the?administrator?to?set?certain?paths?so?that?they?are?not?overridable?by?users.?In?contrast,?all?mount?points?in?the?user?specific?fstab?file?are?user?mount?points.

The?fifth?and?sixth?field?are?ignored.?They?are?so?far?only?specified?to?keep?a?Linux-like?fstab?file?layout.

Note?that?you?don’t?have?to?specify?an?fstab?entry?for?the?root?dir,?unless?you?want?to?have?the?root?dir?pointing?to?somewhere?entirely?different?(hopefully?you?know?what?you’re?doing),?or?if?you?want?to?mount?the?root?dir?with?special?options?(for?instance,?as?text?mount).

Example?entries:

Just?a?normal?mount?point:

c:/foo?/bar?fat32?binary?0?0

A?mount?point?for?a?textmode?mount?with?case?sensitivity?switched?off:

C:/foo?/bar/bazntfstext,posix=0?0?0

A?mount?point?for?a?Windows?directory?with?spaces?in?it:

C:/Documents\040and\040Settings?/docs?ext3?binary?0?0

A?mount?point?for?a?remote?directory?without?ACL?support:

//server/share/subdir?/srv/subdirsmbfsbinary,noacl?0?0

This?is?just?a?comment:

#?This?is?just?a?comment

Set?the?cygdrive?prefix?to?/mnt:

none?/mntcygdrive?binary?0?0

Whenever?Cygwin?generates?a?Win32?path?from?a?POSIX?one,?it?uses?the?longest?matching?prefix?in?the?mount?table.?Thus,?if?C:?is?mounted?as?/c?and?also?as?/,?then?Cygwin?would?translate?C:/foo/bar?to?/c/foo/bar.?This?translation?is?normally?only?used?when?trying?to?derive?the?POSIX?equivalent?current?directory.?Otherwise,?the?handling?of?MS-DOS?filenames?bypasses?the?mount?table.

If?you?want?to?see?the?current?set?of?mount?points?valid?in?your?session,?you?can?invoking?the?Cygwin?tool?mount?without?arguments:

Example?3.1.?Displaying?the?current?set?of?mount?points

bash$?mount

f:/cygwin/bin?on?/usr/bin?type?system?(binary,auto)

f:/cygwin/lib?on?/usr/lib?type?system?(binary,auto)

f:/cygwin?on?/?type?system?(binary,auto)

e:/src?on?/usr/src?type?system?(binary)

c:?on?/cygdrive/c?type?user?(binary,posix=0,user,noumount,auto)

e:?on?/cygdrive/e?type?user?(binary,posix=0,user,noumount,auto)

You?can?also?use?the?mount?command?to?add?new?mount?points,?and?the?umount?to?delete?them.?However,?since?they?are?only?noted?in?memory,?these?mount?points?will?disappear?as?soon?as?your?last?Cygwin?process?ends.?See?the?section?called?搈ount?and?the?section?called?搖mount?for?more?information.

Note

When?you?upgrade?an?existing?older?Cygwin?installation?to?Cygwin?1.7,?your?old?system?mount?points?(stored?in?the?HKEY_LOCAL_MACHINE?branch?of?your?registry)?are?read?by?a?script?and?the?/etc/fstab?file?is?generated?from?these?entries.?Note?that?entries?for?/,?/usr/bin,?and?/usr/lib?are?never?generated.

The?old?user?mount?points?in?your?HKEY_CURRENT_USER?branch?of?the?registry?are?not?used?to?generate?/etc/fstab.?If?you?want?to?create?a?user?specific?/etc/fstab.d/${USER}?file?from?your?old?entries,?there’s?a?script?available?which?does?exactly?that?for?you,?bin/copy-user-registry-fstab.?Just?start?the?script?and?it?will?create?your?user?specific?fstab?file.?Stop?all?your?Cygwin?processes?and?restart?them,?and?you?can?simply?use?your?old?user?mount?points?as?before.

服務(wù)端rsyncd.conf配置文件:

use chroot = false

strict modes = false

port = 873

hosts allow = IP地址,多個(gè)IP地址用逗號(hào)隔開(kāi)

log file = /home/rsync/rsyncd.log

pid file =/home/rsync/rsyncd.pid

uid = root

gid = root

max connections = 512

# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

[項(xiàng)目名稱(chēng)]

auth users = rsyncuser //同步時(shí)使用的用戶(hù)名

secrets file = /home/rsync/rsyncd.pas //用戶(hù)名密碼校驗(yàn)文件

path = /home/data/cacheinfo/ ?//同步的目錄

read only = false

transfer logging = yes

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容