2

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?

5
  • Why doesn't the unison approach work? Have you considered using a version control system for this?
    – pjc50
    Dec 3, 2009 at 11:39
  • You want a change in one place to end up on the other two?
    – innaM
    Dec 3, 2009 at 12:32
  • @Manni: yes - it should work in all directions.
    – user7385
    Dec 3, 2009 at 13:36
  • Because you're already using unison I think a plain rsync is not what you want?
    – cringe
    Dec 3, 2009 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, 2009 at 14:34

7 Answers 7

4

Have you tried Dropbox for Linux?

3
  • 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, 2009 at 14:31
  • No action required, but for 100GB it's probably not the right tool
    – user12889
    Dec 3, 2009 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, 2009 at 23:16
3

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

example1.prf

# Unison preferences file

root =  /Users/XXXX/Desktop/a 

root = /Users/XXXX/Desktop/b

perms = 0

#confirmbigdel = false

example2.prf

# 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.

2

NFS or Samba, no cron jobs required.

2
  • Neither of these work well in scenarios with not-so-good connectivity.
    – user7385
    Dec 13, 2009 at 16:29
  • People might not want to use it when they need to sync between two servers. I e.g. want both servers to have a local copy of the config-file because I don't want to make them dependent on a network-share. Direct A-B sync does not work due to firewalls.
    – Chris
    Mar 16, 2023 at 16:59
1

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

3
  • 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, 2009 at 12:21
  • Since you seem to have huge amount of data, GIT won't work either. Dec 3, 2009 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, 2010 at 15:23
0

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

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

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.

1
  • 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, 2009 at 22:09
0

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.

You must log in to answer this question.