Sunday, January 10, 2010

RSync for Windows: cwrsync

RSync is a very popular backup software in the Unix world. Unfortunately, there is no native port of it. An alternate answer would be cwrsync. It comes as a single installer containing a minimal cygwin x86 set, and the latest x86 compiled Rsync.

Integration with Windows server
The installer setups a new classic windows service:
Since its a service, we have to choose a user account for running it. This permits controlling very precisely the permissions the rsync user will be granted.

Permissions, privileges
In my example, I wanted to perform an incremental backup solution using dirvish (which relies on rsync) on the linux server. That is why I only needed READ permissions for the account backupsvc (and since it is also a service account, the right Logon as a service also has to be granted):

RSync shares configuration
You then have to define "shares" (similarily to smb). In our example, the share is named "test", and it points to the folder C:\Shares
We assigned read-only = true, for the rsync server not to try to write anything to the share. Note: if we would have set it to false, we however could adjust this thanks to NTFS permissions.
Transfer logging is especially important when your rsync synchronization fails.
hosts allow is not really usefull, since we will control this later using the Windows Firewall.

Network security
From the RSync Wikipedia article it binds by default on TCP 873, but also UDP 873.
The Windows Firewall with Advanced security lets us control precisely the remote IP initiating a connection to the rsync server.

Running processes
Once the Rsyncserver service is started, there are 3 processes running under the account previsouly defined:
- conhost: for the service to be controlled as a classic windows service.
- cygrunsrv.exe*32 : Cygwin environnment
- rsync.exe*32: rsync service

Please note that these processes are only x86 processes at the time I am writing these lines.

You have to be carefull on:
- permissions on files/folders to be backed up
- permissions/rights granted to the service running the rsync server service
- firewall rule
- rsync config file

From a debian server:

Going further
If you are interested in setting up an incremental backup on a debian server, I advise you to check the dirvish and rsync websites.

No comments:

Post a Comment