Personal #backup#ssh#windows 2 min

Unison: similar to rsync but better in many ways

Translation of the original in Catalan. Read it in: CatalàCastellano

Through an article on BULMA I've recovered a reference I had forgotten some time ago and I don't remember why. In fact, I even tried Unison but right now I have it completely forgotten inside my head. So I plan to use it for a while; unless I tell you otherwise I recommend it, because from what I've read it solves many of the problems I have with rsync. Above all when making backups on servers where I don't want to have rsync running, and in windows infrastructure where, although I use an rsync port for win, it leaves a lot to be desired.

unison.png
Screenshot of Unison on my laptop

So, the most remarkable thing is that we can synchronize two PCs without having to leave any new port open, simply connecting through SSH, for example.

Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

  Unison shares a number of features with tools such as configuration management
  packages ([CVS](http://www.cyclic.com/), [PRCS](http://www.xcf.berkeley.edu/~jmacd/prcs.html),
  [Subversion](http://subversion.tigris.org/), [BitKeeper](http://www.bitkeeper.com/),
  etc.), distributed filesystems ([Coda](http://www.coda.cs.cmu.edu/),
  etc.), uni-directional mirroring utilities ([rsync](http://samba.anu.edu.au/rsync/),
  etc.), and other synchronizers ([Intellisync](http://www.pumatech.com/),
  [Reconcile](http://www.merl.com/reports/TR99-14/), etc). However,
  there are several points where it differs: 
  • Unison runs on both Windows and many flavors of Unix (Solaris, Linux, OS X, etc.) systems. Moreover, Unison works across platforms, allowing you to synchronize a Windows laptop with a Unix server, for example.
  • Unlike simple mirroring or backup utilities, Unison can deal with updates to both replicas of a distributed directory structure. Updates that do not conflict are propagated automatically. Conflicting updates are detected and displayed.
  • Unlike a distributed filesystem, Unison is a user-level program: there is no need to modify the kernel or to have superuser privileges on either host.
  • Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an encrypted ssh connection. It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.
  • Unison is resilient to failure. It is careful to leave the replicas and its own private structures in a sensible state at all times, even in case of abnormal termination or communication failures.
  • Unison has a clear and precise specification.
  • Unison is free; full source code is available under the GNU Public License.