rsync: installation and implementation

I wrote up these directions (based on directions @ on a couple weeks ago when I was doing some work with rsync. Someday I’m sure I’ll need them again… and maybe someone else will benefit. So here goes nothing:

Download this zip file (which contains cygwin1.dll,instsrv.exe,rsync.exe and srvany.exe) (I mirrored it here)

Decompress the contents to c:\rsync.

Copy out cygwin1.dll to c:\(system folder)\system32, where system folder is either winnt or windows depending upon your OS.

Open a command prompt and type:

cd c:\rsync
instsrv Rsync “c:\rsync\srvany.exe”

Click on Start, run, and type in regedit.

Once you’re in the Registry Editor, make the following changes (Quotes ARE important!):

HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> Rsync

Right click on Rsync, New -> Key Key Name: Parameters
Right click on Parameters New -> String Value
Value Name: AppDirectory
Value: “c:\rsync”

Right click on Parameters New -> String Value
Value Name: Application
Value: “c:\rsync\rsync.exe”

Right click on Parameters New -> String Value
Value Name: AppParameters
Value: –config=”c:\rsync\rsyncd.conf” –daemon

Close the Registry Editor.

If this is the source machine (ie: a machine you’d like other machines to copy/sync with), open up c:\rsync\rsyncd.conf in notepad and modify the rsync share setting giving it a well-known, descriptive name. Modify the path to point to a directory that you want to make available for others to get access too. Save and close rsyncd.conf.

Open up Administrative Tools either off the Start Menu or in Control Panel. Double click Services. Scroll down the list to Rsync. Highlight it and start the service.

To test it, open up a command prompt and type:

telnet localhost 873

If you get a connection, rsync was installed successfully. Congratulations!

If this is a machine you’d like to have copy/sync with a remote host, then bring up a command line and type:

cd c:\rsync

For example, if I had a staging server located at ip address with a share called “” that I wanted to sync with, I’d type something like this:

rsync -rt –progress –delete f:/fInetPub/hosts/

where is my staging server, is the rsync share, and f:/fInetPub/hosts/ is the destination that I want to be synced up. Note that if you don’t want files deleted from destination that have been deleted in the source, you should remove the –delete option.

If you’d like run through a sync as a test, add the -n flag like this:

rsync -rtn –progress –delete f:/fInetPub/hosts/

Rsync will list out the files that it *would* have copied/deleted.

The synchronization can (and probably should) be run as a scheduled task using Windows Task Scheduler. To do this, create a .bat file, add the following text (substituting your source, share, and destinations):

cd c:\rsync
rsync -rt –progress –delete f:/finetpub/hosts/

and then use the Windows Scheduler (Start –> Programs –> Accessories –> System Tools –> Scheduled Tasks) to create a task that fires every n (minutes? hours?) per day.

Questions or problems? Email me.

5 thoughts on “rsync: installation and implementation”

  1. You’re directions to setup rsync are great! I’m having a little problem with the rsync server though. I’ve got a w2k server running the rsync service. I was able to sync with the rsync server without difficulty until I re-booted the W2k box. Now, I see that the rsync service is no longer listening on port 873. Any ideas would be immensely appreciated! Thank you in advance.

    Ryan Christensen

  2. hey Ryan,

    Couple things you can check on:

    a) make sure that after restarting the box that the registry changes you made are still there… I’m completely guessing that maybe your sysadmin has a policy that doesn’t allow registry changes or something. start –> run — regedit –> browse to the
    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services -> Rsync

    key. Still there? then….

    b) find out if the service is throwing errors at startup, you can check the Event Viewer to see if something is off…

    c) is it possible that you installed it while logged in a user A and then rebooted and logged in as user B? maybe user B doesn’t have permissions to run the service?

    d) make sure that the Rsync service is set to startup Automatically (start –> settings –> control panel –> administrative tools –> services –> scroll to the rsync service… right click for properties)

    That’s all I can think of!

    Hope that helps!


  3. hi,
    can u give me directions to implement this actual rsync algo in JAVA.. we need to do this as a part of our project…any help will be appreciated…thanks in anticipation

  4. Hi,

    I found it really a good site for rsync setup.But I am facing one problem while setting up,I am not getting what name I need to provide for rsync share in the host machine Example rsync -rt –progress share c:\testbeds .Could any one of you help me in this regard.(What name I need to provide in rsync share place)

    Thanks in advance

  5. Hi Roopa,
    For rsync setup rsync -rt –progress share c:\testbeds
    rsync share should be your destination server port #
    – Aaron Johnson

Leave a Reply

Your email address will not be published. Required fields are marked *