Question: I would like to do a two-way automatic sync between folders `Directory A` and`Directory B`. This means that whenever a file in `Directory A` or one of its sub-directories is changed, that change is immediately applied to `Directory B`, and whenever a file in `Directory B` or one of its sub-directories is changed, that change is immediately applied to `Directory A`. Thus, the two directories would be completely identical, including document properties. How can I achieve this?

I am using Ubuntu 16.10. 

Symlinks are not an option.

Answer: 
I would recommend the `synkron` tool. This is an open-source application available for linux(and other OS's). More recent copy of the file is updated over folders based on the time stamp. The frequency of the sync is user defined. 

To install you have to build it which requires Qt 4.3 or recent version. 

Check the sourceforge page ( [synkron on sourceforge](https://sourceforge.net/projects/synkron/?source=navbar)) to download and installation details.

Advantages over `rsync+cron` and other simple approaches:

* A temporary backup is created which is saved for certain duration of time.
* Option to not propagate deletions.
* Multiple folder can be linked as masters, or slave-master configuration.

Project page - [Synkron page](http://synkron.sourceforge.net/#) / Documentation - [Synkron documentation](https://sites.google.com/site/synkrondocumentation/)
I wrote Poni after getting frustrated with lsyncd, lsyncd wasnt syncing correctly and I had to restart service constantly to pick up inotif changes,

this is a binary written in Crystal that uses inotify lib and rsync to do the actual file/dir sync between 2 hosts, using it in production now, no issues

<https://github.com/perfecto25/poni>

also have a python version of this,

<https://github.com/perfecto25/isync>