File synchronisation with Unison and plink

Unison is a free file synchronisation tool for Unix and Windows, which allows (amongst other things) two replicas of a collection of files and directories to be stored on different hosts. Unison can synchronise files securely through an SSH session; however, it is designed for use with OpenSSH-style clients, and can be difficult to integrate with other SSH clients. This batch file allows Unison to be used from the Windows 2000 command line with plink, a free SSH tool which is part of the the excellent PuTTY suite by Simon Tatham. plink is small, easy to install and freely distributable.

The batch file, sync.bat, can be downloaded here.
Unison may be found at http://www.cis.upenn.edu/~bcpierce/unison.
plink may be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/.

Installation and use:

  1. Save sync.bat, preferably in your path.
  2. Download Unison (Win32 text interface binary) and plink.exe.
  3. Run plink user@remote-host (substituting user for the username on the remote SSH server and remote-host for the remote SSH server hostname), and store the SSH server key in PuTTY's cache if prompted. An SSH session to the remote server should be established; log out with exit.
  4. Edit the following environment variables in sync.bat:
  5. Run sync.bat from the command line with no parameters for a syntax summary.