tkshi / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

Bi-directional sync (possibly with unison?) #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I was just wondering if a bi-directional sync might be doable by running lsyncd 
on two (or more) computers pointing at the same path and using unison.  I 
haven't researched to see if unison can handle running from each direction at 
the same time yet, either.

Original issue reported on code.google.com by silfr...@gmail.com on 14 Nov 2011 at 3:20

GoogleCodeExporter commented 8 years ago
I just stumbled across the csync2 overview that might help me along the way 
fairly well; it sounds like lsyncd might be able to do something similar to 
this fairly easily.

http://www.axivo.com/community/threads/lightning-fast-synchronization-with-csync
2-and-lsyncd.121/

Original comment by silfr...@gmail.com on 14 Nov 2011 at 6:45

GoogleCodeExporter commented 8 years ago
Its doable with rsync, you have to add tempdir to its options, so it doesn't 
make the temporary files in place (and thus result in mutual infinite event 
recursion)

So far I never had the time to dive into unison or csync2. I just made the 
interface layer for rsync as default config. If it works it works. 

Note that master-master (bi-directional) is not "officially" (I'm not an office 
anyway :-) supported. If the same files changes on both side, you _will_ get a 
race condition. If some system on both sides has a set of files and both change 
it at the same time, you will get a mashup of the files (some files from system 
A, some on system B), when they interdepent, it will ruin the set. For these 
cases you need a synchronous solution, which Lsyncd is not.

They work something like that: system A issues a lock, waits for system B to 
acknowledge the lock, system A passes the held access from userspace to the 
files, userspace closes files, A tells B the changes, B acknowledges, A 
releases the lock, B acknowledges - versus how Lsyncd works: A sends B the 
files diffs of all changes that happened in the last 30 seconds.

Original comment by axk...@gmail.com on 16 Nov 2011 at 10:37

GoogleCodeExporter commented 8 years ago
Your issue has been moved to https://github.com/axkibe/lsyncd/issues

Original comment by axk...@gmail.com on 16 Nov 2011 at 3:59