Installing RSYNC for Windows XP

. 29 August 2008
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks

With thanks to "Brent Norris" for his email and containing files.


I have created this page to help others who wish to use Rsync to backup M$ Windows based machines to Linux/Unix Servers or to other Windows Workstations/Servers. I hope you find this example useful. It is tried and tested for my case to backup my data from M$ Windows based to Mac OS X cross to the network at my office (PPTI BPID Kaltim).

This document will have you that you want to install rsync as daemon on M$ Windows based machines without installing the entire cygwin suite.

You will need the following files:

From Cygwin:


  • cygpopt-0.dll

  • cygwin1.dll

  • rsync.exe


These are available from http://www.cygwin.com or you can download from here.

From the Windows NT or 2000 Resource Kit.

  • instsrv.exe

  • srvany.exe


For simplicity I have zipped and upload them up and made them available here.

OK.. Please be careful where you place the server as any one who can see it can read from this service.

  1. Place rsync where you want to run it from.
    (I usually use C:\program files\rsync)

  2. Put the two dll's anywhere in the path, usually C:\winnt\system32 or c:\windows\system32.

  3. From a shell running in the directory containing instsrv and srvany type:
    (Replace C:\Rsync\ as appropriate)



  4. You should now have a new service called Rsync and you can verify by looking in
    Start->Control Panel->Services
    (you can also open services.msc from a run command on Windows XP or newer)
    PLEASE, DON'T START IT YET!



  5. If you want to run rsync in daemon mode you will need a configuration file. Here is the one I use, call it
    rsyncd.conf
    and place it in the same directory as rsync
    (C:\Program files\rsync\rsyncd.conf)

    use chroot = false
    strict modes = false
    hosts allow = *
    log file = c:/rsyncd.log

    [downloads]
    path = C:/Downloads/
    read only = yes

    [directory_d]
    path = D:/
    read only = yes

    (The command line to connect would look something like "rsync -vr server::dowloads", where server is the name of the server running the rsync daemon.)
    The first two lines are important for rsync to work on Windows.
    use chroot = false
    This command captured from my iMac PC.



  6. You are going to need to hack some keys in the registry to make it work. Don't do this unless you are comfortable with the changes! Run regedit32 and add the following keys and values (quotation marks ARE IMPORTANT):

    HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Rsync
    Edit->Add Key-> Key Name: Parameters
    Edit->Add Value-> Value Name: AppDirectory Value: "C:\Program Files\rsync"
    Edit->Add Value-> Value Name: Application Value: "C:\Program Files\rsync\rsync.exe"
    Edit->Add Value-> Value Name: AppParameters Value: --config="C:\Program Files\rsync\rsyncd.conf" --daemon --no-detach

    If you would like to add these keys automatically, there is a .reg file in the rsync.zip file hosted at the top. Just double click on rsync-param.reg

    Remember, unless you trust me implicitly, read the reg file and make sure you understand what it's doing before you run it.

  7. You will probably have to open up the services control panel and double click on the Rsync service. Open the Log On tab and either change it to logon using the Local System account or edit the account information to a valid login account.

  8. That's it, you should be able to start and stop the rsync service at will using the Services Control Panel. When running with the above configuration you should be able to test by attempting to telnet to port 873 from a remote machine. telnet rsync.server.com 873 (replacing rsync.server.com with your own server's address) You should get a connection to the rsync daemon running on your server.

    Here is capture firewall activity monitoring from my COMODO Firewall, and make sure that you hade add ports 873 into your firewall configuration to enable rsync services.



I hope to hear anyone who has any success with these page, and I always welcome comments and feedback.

2 comments:

Mille said...

If you got an error "instsrv.c: Error 1057 from CreateService? on line 103" it is because your Administrator account is not named "Administrator"; simply rename the account, create the service, then rename it back to it's original. Then in the service control panel applet, you will have to manually change the Log On credentials to that of the renamed administrator account (it will subsequently grant this account the "Logon As Service" right).

Anonymous said...

Hello,

I get an error "connection refused(111)". Do you have the same problem?