Simple configuration method for synchronizing data under windows with cwrsync

  • 2020-05-07 20:39:35
  • OfStack

cwrsync download address

http: / / sourceforge net projects/sereds files/cwRsync or to s. ofstack. com download

cwrsync is divided into two parts: the client side and the server side. Take cwrsync version 4.0. for example, cwRsync_4.0.5 _Installer.zip and cwRsyncServer_4.0.5 _Installer.zip respectively

Installation:
Client installation is relatively simple, 1 straight down 1 step.
When the server is installed to step 1 of Service Account, this step will create the system account of cwrsync. You can use the default account or you can customize the account and password. This account will be useful for synchronization later.
Once installed, add the installation directory to the path variable of windows to make it easy to invoke the rsync command directly from the command line.

The environment
Server (server where the data needs to be synchronized):192.168.1.77
Client (server that needs to synchronize data):192.168.1.2
Data to be synchronized :d:\home
Need to synchronize to e:\www\home

server:
Click on 192.168.1.77
Start - all procedures - cwRsyncServer-01.rsyncd.conf
Open the configuration file for cwrsync and enter the following
 
[site] 
path = /cygdrive/d/home 
hosts allow = 192.168.1.2 
hosts deny = * 
list = true 
uid = 0 
gid = 0 

And then click
Start-run-cmd (enter)
Open a command line window and execute
net start RsyncServer
Start the cwrsync service

Note: d:\home this directory should be read by cwrsync system users (the account created when cwrsync server is installed is SvcCWRSYNC by default), otherwise the client will report an error when synchronizing (@ERROR: chdir failed).

client:
Click on the
Start-run-cmd (enter)
Open a command line window and execute
rsync -avz 192.168.1.77::site /cygdrive/e/www/home

That's when cwrsync starts synchronizing the data for us

Note: the rsync command cannot be executed if the cwrsync installation directory was not just added to the path variable of windows. Add method, for example, if I install cwrsync client in D:\Program Files\cwRsync, I need to add D:\Program Files\cwRsync\bin to windows system path variable. After adding, you need to reopen the cmd command line window to execute the above command.

Related articles: