background="/styles/ricebk.jpg">
Logo
Valid CSS!  Valid HTML 4.01!
Contact

Introduction

OK, your obviously not a dummy or you wouldn't be here. Now you have to find out if I am when you work through these notes.

Here I explain how to synchronise two Windows 2000 machines using rsync. My experience was that while available help was well written, it was interlaced with Linux stuff which left me cold. Here I am trying to write it down in terms everyone will understand.

Rsync

Rsync comes in two parts - a client and a server. The server receives data from the client and stores it in sub directories of its installation folder - nowhere else.

It needs a component called CYGWIN: I believe its a 'dll' that allows Windows machines to run linux programs (like Rsync) in emulation mode.

Fortunately you can get these all bundled up in CWRSYNC.

The process is as follows:

  1. Download CWRSYNC from their site
  2. On the server - the machine to receive the data - install CWRSYNC; it will listen for any client machines that wish to synchronise. Install it in a directory or drive where you want to store your synchronised copies - Program Files is probably not a good idea!
  3. Once installed then you have to set up the server configuration file rsync d.conf. You will see some of this is already in the default .conf file
use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid
Module definitions
Make sure that writable modules are implemented as subdirectories of <cwRsync installation
Directory>\data. That would ensure propagation of correct ownership for files/directories.

[test]
path = /cygdrive/c/Program Files/cwrsync/data1
read only = false
transfer logging = yes
  1. The Path statement is the tricky one (for me anyway); it tells the server where to store the data but the path seems to be nonsense. The path above corresponds to storing data in C:\Program Files\CWrsync\data1
  2. The [test] label indicates the name of the job (you could have many different jobs in the .conf file)
  3. Create a user with restricted rights on the server machine; in the example his userID is cwrsync; the user will have full rights on the data directory under your cwrsync install and should be able to read and write to the cwrsync install folder.
  4. Install the client on the sending machine while logged on as administrator and be sure to set the PATH statement in the client computer to include "C:\Program Files\cwrsync\" or wherever you installed it; work ou the files and folders which have to be synchronised. Create (or update on supplied) a batch file with the following lines, and store in the CWRSYNC client directory.
set CYGWIN=nontsec
           rsync -vrtz --delete /cygdrive/P/TCMPaths cwrsync@loft::test.
I can't remember what all that means - see the rsync documentation. However the main elements are:
  • rsync - the program
  • -vrtz (read the manual!)
  • -delete deletes files on the mirror copy if they have been deleted on the client
  • /cygdrive/...your path to be replicated; to you and me that corresponds to P:\TCMPaths
  • cwrsync@loft - the name of the cwrsync user@ the computer name ( see notes above on the setting up of this user)
  • ::test (yes that's two colons) That is the name of the job, as defined on the server, in the RSYNC conf file
Set a schedule in Windows Task schedule to run the batch file at the interval you want. For example, I back up one machine to another at night.

I just changed the server computer name, and have to remember to change the rsync client information so it can find the right machine


© PedleyOnline
Transmitted : Friday, July 04th, 2008Locations of visitors to this page
'Last Modified: Sunday, February 29th, 2004