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

share|improve this question

migrated from stackoverflow.com Mar 23 '13 at 3:11

This question came from our site for professional and enthusiast programmers.

    
Unidirectional or bidirectional sync? –  cdhowie Mar 22 '13 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 '13 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 '13 at 21:22
    
@cdhowie: Ahh. The file will change on both sides. –  Micy Bart Mar 22 '13 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 '13 at 5:33

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

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