From SuperUser https://superuser.com/a/31578
Unison might be a good candidate:
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.
It already does 2-way syncs. I think you can daisy-chain the 3 machines with 2-way syncs to get what you need. e.g
machines A, B, C => (A <-> B), (B <-> C), (C <-> A)
It's not ideal, but I couldn't find anything better at the moment.
I've learnt that there are very few things rsync cannot do, and it can probably provide an equal or better solution, but you'll have to wait for an rsync expert to turn up for that solution.
Unison can sync more than 2 machines. From their user manual:
Using Unison to Synchronize More Than Two Machines
Unison is designed for synchronizing pairs of replicas. However, it is possible to use it to keep larger groups of machines in sync by performing multiple pairwise synchronizations.
If you need to do this, the most reliable way to set things up is to organize the machines into a “star topology,” with one machine designated as the “hub” and the rest as “spokes,” and with each spoke machine synchronizing only with the hub. The big advantage of the star topology is that it eliminates the possibility of confusing “spurious conflicts” arising from the fact that a separate archive is maintained by Unison for every pair of hosts that it synchronizes.