[School of Physics - Optics Group]

Help in putting together RSYNC for Windows

Links to sections below:  

What is RSYNC?

RSYNC is a program for copying files between networked computers. It is "special" because if the same file already exists, it copies only the differences between the files, therefore saving network traffic. Thus, you can make a mirror copy of a hard drive, and keep the two copies identical, over a modem link.
rsync is fairly straightforward for Unix machines, but if you want to use it with Windows as well, it's a nightmare. This is a detailed guide to getting RSYNC running on Windows and Unix systems. It is motivated by my own frustration in achieving a working system, frustration borne mainly from a lack of detailed documentation. There is some (very helpful!) documentation already, but it took me a long time to sift through it and work out what was needed, what worked, what didn't. I wanted only the bare minimum so that colleagues could take advantage of it with minimum hassle.

Why did I bother? I wanted to: Both of these things can be done in other ways, but rsync seems to have some advantages, particular when syncing a notebook to a remote server, which is something I do every night after hours of working on, say, a Powerpoint presentation.

Links

For other information, look at: For software referred to below:

How I use it

The basic idea I have adopted is to have RSYNC running on a special (Linux) file server, and for desktop/notebook/workstations to send their files there. Note that I have not tried to use a Windows box as a server, although that is possible (see rsync on NT by Mike Henry).

rsync can communicate in two ways: using a remote shell (rsh or ssh), or with its own internal protocol, loosely referred to as "rsync server mode". I now have both of these working, thanks to specific updates by Dave Dykstra (thanks!), and both are documented below. However, server mode is more hassle for multiple users, and less secure, so I recommend taking the extra time to get ssh working.

ssh on Unix

Install ssh on your Unix/Linux rsync server.
  1. Get ssh version 1.2.27. While versions 2.x probably have advantages, they are not freeware. They are also more difficult to compile and run for Windows machines.

    Download ssh-1.2.27 source from any gnu site, for example Australia.

    Once you have untarred it, you just need to (as root): You should also make sure that sshd is started automatically, e.g. with a line in your rc.local script.


  2. Create the necessary security keys on the server. Log in as a regular user and: For added security, you can use passkeys, but empty passphrases are probably fine for most of us.

    I have written a short script so that users can do this trivially. See dossh.


ssh on Windows

This is better documented in Installation guide for rsync on Windows. Here I include a little more detail if you need to do it yourself.
  1. Use ssh version 1.2.26. Huh? Yes. Compiling ssh on a winbox is a pain. You can get a precompiled version of both 1.2.26 and 1.2.27, but the latter needs a special version of cygwin1.dll, and gave me various forms of grief. 1.2.26 works just fine.



  2. Try ssh.
    At this point, you should be able to log in to the remote rsync server from your windows box, using ssh. Try it. From an MS-DOS command window, or an NT command window: You will probably be told that your windows box is not authorized, and asked if you want to add it. Yes (all three letters, y, e, s). If you are asked for a password, something is wrong; please read the (dreadful) ssh documentation.


  3. rsync on Unix

    Install rsync on the Unix rsync server. This is generally straightforward. You probably should get the latest (devlopmental, i.e. beta) release, particularly because there are a number of bugs in the latest formal release (2.3.2) relating to windows and to using server mode. Look for rsync beta.

    Once you have it, as root: You can simply run rsync as a daemon, or you can have it started automatically by inetd. In /etc/services add: and in /etc/inetd.conf add:

    rsync on Windows

    1. You can compile your own trivially, if you have the full cygwin development suite installed (great stuff!). Download from Cygnus. Jump to one of the listed mirror sites and look for cygwin-b20/full.exe.

      Alternately, download my own precompiled binary



    2. Test it.
      On the windows box, try:
        set CYGWIN=tty binmode
        set PATH=/rsync;%PATH%
        rsync -e ssh -av "\\d/" unixbox:/rsync
      Note that the path must be set to include wherever you put your ssh.exe.


    3. Problems
      • Don't use the -x option from a windows box. Strange things happen.
      • Try -vvv if it hangs. This was essential with rsync 2.3.2, but the development version seems to have fixed it.


    4. Latest (beta) rsync

      To get latest rsync, assuming you have a working rsync already: This will get the latest *development* version of rsync. To install:
      In my case, I don't do the latter: I copy rsync to /usr/local/bin/rsync-2.4.2 and link it (version number changes of course).

      Created: 5 January 2000
      Updated: 1 February 2000
      Maintainer: Robert Scholten, School of Physics, Email:  r.scholten at physics.unimelb.edu.au
      Authorised by: Robert Scholten, School of Physics, Email:  r.scholten at physics.unimelb.edu.au
      This page, its contents and style, are the responsibility of the author and do not represent the views, policies or opinions of The University of Melbourne.