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.