使用 cwRsync 從 win 同步代碼到 Linux

來源:互聯網
上載者:User

需要在 win 下編寫代碼, 在 Linux 上進行調試. 採用 rsync 來進行同步. 以下為部署過程.

win

1. 下載和安裝  cwRsycServer , 安裝目錄為 Dir .

2. 修改 Dir 下的 rsyncd.conf 為

uid = 0gid = 0use chroot = falsestrict modes = falsehosts allow = *log file = rsyncd.log# Module definitions# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work#[test]path = /cygdrive/e/project/testread only = falsetransfer logging = yesauth users = tssecrets file = rsyncd.secrets

3. 在 Dir 下建立 rsyncd.secrets

ts:123

4. 在 cmd 環境中, 使用 Dir/Bin/chmod.exe 修改 rsyncd.secrets 許可權為 600

5. 運行 Dir/Bin/ 下的 PrepUploadDir.exe

5. 啟動 RsyncServer 服務

Linux

1. 建立 rsync_test.sh

#!/bin/shpass_file=/home/rsync_passif [ -f $pass_file ]then        rsync -rv ts@10.1.14.59::test --password-file=$pass_file /home/project/ fiexit 0

2. 建立 /home/rsync_pass, 內容為對應使用者的密碼

123

3. chmod 600 /home/rsync_pass

4. 運行 "crontab -e" 添加

#sync pwvs source code between win and linux* * * * * /home/do/rsync_test.sh > /dev/null 2>&1* * * * * sleep 20; /home/do/rsync_test.sh > /dev/null 2>&1* * * * * sleep 40; /home/do/rsync_test.sh > /dev/null 2>&1

使同步指令碼每隔 20 秒運行一次

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.