Use cwrsync to synchronize code from win to Linux

Source: Internet
Author: User

You need to write code under Win and debug it on Linux. Rsync is used for synchronization. The following is the deployment process.

Win

1. Download and install cwrsycserver. The installation directory is dir.

2. Modify rsyncd. conf under DIR

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. Create rsyncd. Secrets under DIR

ts:123

4. In the CMD environment, use DIR/bin/chmod.exe to change rsyncd. Secrets to 600.

5. Run prepuploaddir.exe under DIR/bin /.

5. Start the rsyncserver Service

Linux

1. Create 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. Create/home/rsync_pass with the corresponding user password.

123

3. chmod 600/home/rsync_pass

4. Run "crontab-e" to add

#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

Run the synchronization script every 20 seconds.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.