0

I need to sync 3 computers between each other in same way as Dropbox does e.g. if file changed on one pc others reflect this change as well. So i have choosen Unison. And found that it works perfect for 2 computers and how about 3 or more ? I tried to specify 3 roots in confg file but it does not work in such way and expects only 2 roots. After few searches found this statement:

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.

But i didn't find any working example where more than 3 pcs making syncing. Below sample config which produce error once run - "Fatal error: Wrong number of roots: 2 expected, but 3 provided"

# Roots of the synchronization
root = /home/dem/testsync/
root = ssh://root@192.168.1.2//home/pc1/testsync/
root = ssh://root@192.168.1.3//home/pc2/testsync/

auto=true
batch=true
confirmbigdel=true
fastcheck=true
prefer=newer
times=true
2

The software itself can only sync 2 folders/computers. So what the documentation tells you is to setup so that one computer is in the center and every other syncs to it.

computer1 <--2way sync --> hub_computer <--2way sync --> computer2
                               ^
                               |
                               |
                           2way sync
                               |
                               |
                               ⌄

might be easier to use syncthing computer3

  • As i understood this model i should keep running unison on each computer pereodically sync them to so called hub. In this way hub itself should not be syncing to any of them, of course it should have unison installed only. – Demontager Dec 11 '15 at 9:23
  • But here also caveat if hub offline syncing will be lost. – Demontager Dec 11 '15 at 9:39
  • I accepted your answer because unison unable to accomplish exactly what i want. So only scheme you shown working for multiple PCs. I tried syncthing, very nice working. Now i'm using them both, unison great for speed and easiness. Syncthing works over NAT it is the biggest his advantage. – Demontager Dec 13 '15 at 11:45
-1

You may use unison but instead try use 2 target root, you may set two configurations of unison, define second profile with other name for example dc2 you may create file with name of profile.prf and call unison with the profile name.

vi ~/.unison/default.prf
vi ~/.unison/dc2.prf


/usr/bin/unison 
/usr/bin/unison dc2
  • done, I think I'm replying to the question , since I had the same problem. – Sérgio Oct 11 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.