I need a way to synchronize files between 3 places, all of which can be modified.

All places are on Linux, and the synchronization tool has to run from cronjob - not manually!.

I tried unison, but I can't make it to work with 3 separate places (I tried configuring by using a<=>b and b<=>c synchronizations, but it doesn't work).

Is there any tool that could do something like this?

  • Why doesn't the unison approach work? Have you considered using a version control system for this? – pjc50 Dec 3 '09 at 11:39
  • You want a change in one place to end up on the other two? – innaM Dec 3 '09 at 12:32
  • @Manni: yes - it should work in all directions. – user7385 Dec 3 '09 at 13:36
  • Because you're already using unison I think a plain rsync is not what you want? – cringe Dec 3 '09 at 14:10
  • @Carsten: I am not aware of a way to setup rsync so that it will make 3-way synchronization. – user7385 Dec 3 '09 at 14:34

Have you tried Dropbox for Linux?

  • I thought that dropbox required user to "do something" to synchronize. On the other hand - I need it to be done automatically. And the amounts of data (~100GB) that I need to be synchronized look like a bad match with dropbox. – user7385 Dec 3 '09 at 14:31
  • No action required, but for 100GB it's probably not the right tool – user12889 Dec 3 '09 at 22:57
  • 1
    If the majority of files remain unchanged, there is not much problem as Dropbox sends only the file's differences between computers (not to mention that has a LAN-only feature to sync them really fast if they are in same LAN). But the real problem is that for 100GB of data it also means that you will have to pay $19.99/month... – Saxtus Dec 3 '09 at 23:16

Unison will do this. Inside the Unison folder that stores sync data (osx path:~/Library/Application Support/Unison), create two .prf files.


# Unison preferences file

root =  /Users/XXXX/Desktop/a 

root = /Users/XXXX/Desktop/b

perms = 0

#confirmbigdel = false


# Unison preferences file

root =  /Users/XXXX/Desktop/b 

root = /Users/XXXX/Desktop/c

perms = 0

#confirmbigdel = false

now run "unison example1" and "unison example2", all folders will sync.

You can take this a step further and have all folders update as soon as a file changes if you build unison from the latest svn. With the latest svn, you can use the flag "-repeat watch" (eg. "unison exampleX -repeat watch") to watch folders for changes, given the fsmonitor.py file is in the same bin directory that you are executing Unison from.

This also works over ssh if the same version is installed on all machines... A private dropbox, basically. It would probably be a benefit to have a server set up, always connected to the internet to accept changes at any time, all computers would connect to that one looking for changes.


An unorthodox idea, couldn't you just use GIT?

  • I think I could, but I don't know it (yet), and I'm not feeling comfortable with learning git on important data. – user7385 Dec 3 '09 at 12:21
  • Since you seem to have huge amount of data, GIT won't work either. – Jimmy Hedman Dec 3 '09 at 21:38
  • Well, I would feel even more comfortable with Git (compared to other solutions) because you cannot possibly ever loose data. Also, Git really does not have problems with huge amount of data. Though, you have the problem that it will keep some redundant data, i.e. at least of the size of the data itself (you can delete data from the history, so also not much more than that). – Albert Jul 6 '10 at 15:23

NFS or Samba, no cron jobs required.

  • Neither of these work well in scenarios with not-so-good connectivity. – user7385 Dec 13 '09 at 16:29

How about Subversion, using a free service like projectlocker or cvsdude? It's very easily scalable.

  • subversion keeps 2nd copy of data in .svn directory. which in case of 100GB of base data is far from practical – user7385 Dec 3 '09 at 17:30

Does the data change at all places all the time? Otherwise you could start your work by doing a rsync from one (that you declare as the master) to the machine you work and then rsync back when you are done.

  • Yes. I have no control about what changes where or when - these are basically 3 offices with some people in all of them. – user7385 Dec 3 '09 at 22:09

I know I'm late to the party, but it is possible to synchronize 3 (or more hosts) with unison. I do this regularly with four machines. I created a star-shaped topology, in which one host is designated 'central', and the others synchronize against this 'central' node, never against each other. It is easiest if there are no changes on the central node. In your case, this would require a fourth node.

Your Answer

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