windows linux 檔案同步 cwrsync工具

來源:互聯網
上載者:User

cwRsync用戶端伺服器端同步處理軟體的windows到windows的配置

準備兩台機器 我的是

伺服器端IP:192.168.1.18

用戶端IP:192.168.1.139

下載cwRsync軟體:

伺服器端:cwRsync_Server_2.0.10_Installer.exe

用戶端:cwRsync_2.0.10_Installer.exe

安裝與配置:

1.伺服器端:

a.安裝cwRsync_Server_2.0.10_Installer.exe軟體;

b.在開始程式中開啟“start a unix bash shell”程式:

進入一個類似cmd的終端,輸入如下命令:

$/bin/activate-user.sh

輸入l

輸入administrator

後面全按回來結束;

c.啟動opensshd

開啟“控制台”-->“管理工具”-->“服務”:

找到一個opensshd的服務,啟動它;

d.配置rsyncd.conf設定檔

編輯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

# Module definitions

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

#

[rsync] #模組名稱

auth users=sunfang #使用者名稱稱

path = /cygdrive/d/test #此處路徑代表d:\test目錄,此可為自訂

read only = yes

transfer logging = yes

secrets file=/cygdrive/d/rsyncd.secrets

e.啟動rsync服務:

開啟“控制台”-->“管理工具”-->“服務”:

找到一個RsyncServer的服務,啟動它

到此server端配置結束,接下來配置client端 。

2.用戶端:

a.安裝client端軟體包:cwRsync_2.0.10_Installer.exe;

b.開啟cmd,執行如下操作,測試服務端是否正常 啟動服務 了:

cd C:\Program Files\cwRsync\bin (到安裝用戶端軟體的安裝目錄下的bin檔案夾下)

telnet 192.168.1.18 22

telnet 192.168.1.18 873

若上述測試成功,此時可執行同步計劃:

rsync -vzrtopg --progress --delete --password-file=/cygdrive/e/sunfang.ps sunfang@192.168.0.201::rsync /cygdrive/d/test

此處的 /cygdrive/e/sunfang.ps 是用戶端的e盤下的sunfang.ps檔案,該檔案內容是sunfang這個使用者的密碼,只存密碼; /cygdrive/d/test是用戶端的d盤下的test檔案夾,用來儲存伺服器端同步處理過來的檔案。 (若密碼檔案打不開,會提示輸入密碼,使用者名稱為sunfang,密碼則為sunfang的登入密碼)

至此,安裝配置windows到windows間的同步已經OK

如果定時同步server上的檔案,可將其加入任務計劃中。

設定檔 :

linux同步WINDOWS檔案 :

windows下rsyncd.conf:

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log

pid file=rsyncd.pid

log file=rsyncd.log

secrets file=rsync.passwd

# Module definitions

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

#

[testxp]

uid=0

gid=0

path = /cygdrive/c/1/bbs

read only = yes

transfer logging = yes

auth users=tiger

exclude =testf

linux: rsync -vzrtopg --progress --delete tiger@192.168.1.6::testxp /tiger/

將windows rsync 配置目錄同步到linux機器/tiger目錄 下

如需上傳:rsync -vzrtopg --progress --delete /tiger/* tiger@192.168.1.6:testxp /

將linux /tiger 目錄下所有檔案上傳到window rsync testxp位置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.