2

I care only about the same file stored in two different machines. I would like to keep changes in sync and as fast as possible. Would rsync as a daemon be up to it? Or is there something else I can use.

11
  • Unidirectional or bidirectional sync?
    – cdhowie
    Mar 22, 2013 at 21:20
  • @cdhowie: bi-directional. I would rather not have one side pushing and polling changes due to speed considerations.
    – Micy Bart
    Mar 22, 2013 at 21:22
  • @MicyBart I mean will the file only ever change on one side, or do both sides need to sync changes to the opposite server? (Is one side a read-only copy?)
    – cdhowie
    Mar 22, 2013 at 21:22
  • @cdhowie: Ahh. The file will change on both sides.
    – Micy Bart
    Mar 22, 2013 at 21:23
  • 1
    @MicyBart: what if files were changed on both sides at exact same time (to nanosecond)? In general, this problem does NOT have simple solution.
    – mvp
    Mar 23, 2013 at 5:33

2 Answers 2

0

You can use unison (http://www.cis.upenn.edu/~bcpierce/unison/) with the --batch option. This will make a bidirectional sync over ssh or ftp.

0

You should check out lsyncd here : https://github.com/axkibe/lsyncd/

This is a daemon which keeps monitoring particular folders, and as soon as something changes in one of the folders, it spawns rsync for synchronization. It is pretty cool and robust. I've been using it without fail.

UPDATE

In case the files reside over network on 2 different systems, syncthing would be a better option.

You must log in to answer this question.