Rsync synchronization between Linux and Windows

Source: Internet
Author: User

1. synchronization between windows and windows
1. Prepare two machines:
Server ----- 192.168.0.201
Client ----- 192.168.0.202

2. Download rsync for Windows
I also forgot the specific software download link, but I should be able to search it on Google.
I also upload it to the cu ......

file: cwrsync_2.0.10_installer.zip
size: 2953kb
download: download
file: cwrsync_server_2.0.10_installer.zip
size: 2821kb
download: download

Server: cwrsync_server_2.0.10_installer.zip
Client: cwrsync_2.0.10_installer.zip

3. installation and configuration
Server:
(1_install cwrsync_server_2.0.10_installer.zip
StartProgramOpen the "Start a Unix bash shell" program:
Enter a terminal similar to CMD and enter the following command:
$/Bin/activate-user.sh
Input L
Enter Administrator
Click Back to end

(2) Start opensshd
Open "Control Panel" --> "Administrative Tools" --> "service ":
Find an opensshd service and start it.

(3) configure the rsyncd. conf configuration file
Edit c: \ Program Files \ cwrsyncserver \ rsyncd. conf with the following content:
Use chroot = false
Strict modes = false
Hosts allow = *
Log File = rsyncd. Log
PID file = rsyncd. PID
# Module Definitions
# Remember cygwin naming conventions: C: \ work becomes/cygwin/C/work
[Rsync] 
Path =/cygdrive/f/rsync (here the PATH represents the F: \ rsync directory)
Read Only = Yes
Transfer logging = Yes
Secrets file =/cygdrive/f/rsyncd. Secrets 

(4) Start the rsync Service
Open "Control Panel" --> "Administrative Tools" --> "service ":
Locate the rsyncserver service and start it.
The server end configuration ends, and the client end is configured.

Client:
(1) install the client package: cwrsync_2.0.10_installer.zip
(2) Open CMD and perform the following operations to test whether the server has started the service properly:
Cd c: \ Program Files \ cwrsync \ bin
Telnet 192.168.0.201 22
Telnet to 192.168.0.201 873
If the test is successful, you can execute the synchronization plan:
Rsync-vzrtopg -- Progress -- delete 192.168.0.201: rsync/cygdrive/D/test
Or:
Rsync-vzrtopg -- Progress -- delete 192.168.0.201:/cygdrive/D/rsync/cygdrive/D/test
(At this time, you will be prompted to enter the password, the user name is administrator, and the password is 192.168.0.201 administrator login password)
Now, the synchronization between windows and Windows has been OK.
If you regularly synchronize files on the server, you can add them to the task plan.

2. synchronization between Windows and Linux as a server
1. Prepare the machine and use Windows as the server
Server --- 192.168.0.201 (Windows)
Client --- 192.168.0.132 (Linux)

2. After the preceding operations, the operations can be simplified.
Log on to the Linux host client to synchronize the server:
# Rsync-vzrtopg -- Progress -- delete 192.168.0.201: rsync/test 

Iii. synchronization between Linux and Windows when Linux is used as a server
1. Prepare the machine and use Linux as the server
Server --- 192.168.0.132 (Linux)
Client --- 192.168.0.202 (Windows)

2. install and configure rsync for Linux Hosts
(1) Check whether Rsync is installed on Linux:
# Rpm-Qa | grep rsync
If not, install the SDK or use tar to compile and install the SDK.
# Rpm-IVH rsync-2.6.8-3.1.rpm

(2) Open the rsync Service
# Chkconfig xinetd on
# Chkconfig rsync on

(3) create the rsyncd. conf file
# Touch/etc/rsyncd. conf
# Vi/etc/rsyncd. conf (content :)
Uid = nobody
Gid = nobody
Max connections = 4

[Www]
Path =/WWW
Comment = backup WWW
Ignore errors
Read Only = Yes
List = No
Auth users = wwwuser
Hosts allow = 192.168.0.202
Secrets file =/etc/wwwuser. Pass

(4) Start the rsync service based on the xinetd Process
#/Etc/init. d/xinetd start

3. Configure windows rsync Client 
(1) install the rsync package of the Client
(2) Open CMD and execute the synchronization plan:
Cd c: \ Program Files \ cwrsync \ bin
Rsync-vzrtopg -- Progress -- delete root@192.168.0.132: www/cygdrive/D/test
(At this time, you must enter the password of the root user to synchronize .)

Now, all configurations are complete.

Note:
To use encrypted synchronization, you can use ......
Rsync-e 'ssh-P 2002 '-vzrtopg -- Progress -- delete root@192.168.0.132: www/cygdrive/D/test

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.