Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two Mac laptops and a Debian server, each with a directory that I would like to keep in sync between the three. The solution should meet the following criteria (in rough order of importance):

  • It must not use any third-party service (e.g. Dropbox, SugarSync, Google whatever). This does not include installing additional software (as long as it's free).
  • It must not require me to use specific directories or change my way of storing things. (Dropbox does this IIRC)
  • It must work in all directions (changes made on /any/ machine should be pushed to the others)
  • All data sent must be encrypted (I have ssh keypairs set up already)
  • It must work even when not all machines are available (changes should be pushed to a machine when it comes back online)
  • It must work even when the /directories/ on some machines are not available (they may be stored on disk images which will not always be mounted)
    • This can be solved for Macs by using launchd to automatically launch and kill (or in some way change the behavior of) whatever daemon is used for syncing when the images are mounted and unmounted.
  • It must be immediate (using an event-based system, not a periodic one like cron)
  • It must be flexible (if more machines are added, I should be able to incorporate them easily)

I also have some preferences that I would like to be fulfilled, but do not have to be:

  • It should notify me somehow if there are conflicts or other errors.
  • It should recognize symbolic and hard links and create corresponding ones.
  • It should allow me to create a list of exceptions (subdirectories which will not be synced at all).
  • It should not require me to set up port forwarding or otherwise reconfigure a network.
    • This can be solved by using an ssh tunnel with reverse port forwarding.

If you have a solution that meets some, but not all of the criteria, please contribute it in the comments as it might be useful in some way, and it might be possible to meet some of the criteria separately.


What I tried, and why it didn't work:

  • rsync and lsyncd do not support bidirectional synchronization
  • csync2 is designed for server clusters and does not appear to work with machines with dynamic IPs
  • DRBD (suggested by amotzg) involves installing a kernel module and does not appear to work on systems running OS X
share|improve this question
1  
Take a look at cis.upenn.edu/~bcpierce/unison/index.html and en.wikipedia.org/wiki/DRBD –  amotzg Aug 13 '12 at 16:01
    
And maybe also read en.wikipedia.org/wiki/… and it's following section. –  amotzg Aug 13 '12 at 16:04
    
+1 to unison :) –  barti_ddu Aug 13 '12 at 21:38
    
Unison seems to be designed for a single client and server. I need a solution that works for any number of machines, some of which may not be online or may appear to not have the directory to sync with at any given time, and some with dynamic IP addresses. –  Blacklight Shining Aug 14 '12 at 10:56
    
I know you don't want to change the way you do things, but have you considered having the directory on the debian server and then just exporting it (nfs) to the macs? That way, everyone is using the same directory. –  terdon Aug 14 '12 at 17:27

1 Answer 1

That's a long list of requirements and I don't think anything exists meeting all of them completely. However, I do have two suggestions that might get very close.

Sparkleshare

I find sparkleshare a very neat solution. It is cross-platform, provides GUI integration/notification, etc. Much like Dropbox, yet hosted yourself. The only thing you need is a central Git repository on some server.

The wizard to start a new project requires you to store your files in a specific directory, not meeting your second requirement. However, you can try to change that in the config.xml to fix that.

I think then there's just one requirement open: hard links support. The use of Git in sparkleshare prevents this - see Git and hard links. If you really really need that, this might be a blocker though.

Git-annex assistant

You might also get involved in another similar project, yet still in early development: git-annex assistant. Because it is using Git-annex, it might overcome the limitation of hard link detection.

share|improve this answer
    
I did think I was being a bit demanding…I will certainly try Sparkleshare; it's probably easier than my lsyncd-shellscript-unison idea (which likely won't preserve hard links, either). –  Blacklight Shining Sep 15 '12 at 9:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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