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: 
[Unison](https://www.cis.upenn.edu/%7Ebcpierce/unison/ "Unison Homepage")
-------------------------------------------------------------------------

> 
> Unison is a GUI and terminal-based tool which allows files and directories to be kept in sync with each other, between different local directories and drives or on a network, which could be on different operating systems. The application is available for Unix operating systems (Linux and Mac OS X) and Windows. Changes can be made on the different places, and Unison will update the machines with the correct versions of files and folders, copying, deleting, renaming or deleting files and directories as necessary.
> 
> 
> 

Unison sync app is probably the most used and trusted by the Ubuntu/Debian community. It is available at the Software Center and at the package manager. It has a command-line and a graphic user interface (GUI)(GTK).

[Ubuntu Help Community Wiki - Unison](https://help.ubuntu.com/community/Unison)

[Ubuntu Manual - Unison](http://manpages.ubuntu.com/manpages/xenial/man1/unison-latest-stable.1.html)

A short use example, close to your request, can be found at [Rmano answer](https://askubuntu.com/a/666079/254056) (screenshot below).

[![screenshot](https://i.stack.imgur.com/BPxJi.png)](https://i.stack.imgur.com/BPxJi.png)

[FreeFileSync](https://www.freefilesync.org/)
---------------------------------------------

> 
> FreeFileSync is a free data backup software that helps you synchronize files and synchronize folders. It is designed to save your time setting up and running data backups while having nice visual feedback along the way. FreeFileSync is Open Source software, available for Windows, Linux and macOS.
> 
> 
> 

I've never tried but it seems to be worth a shot. It has a default GUI and is under active development.

[![screenshot](https://i.stack.imgur.com/nIDGx.png)](https://i.stack.imgur.com/nIDGx.png)

[Synkron](http://synkron.sourceforge.net/)
------------------------------------------

> 
> Synkron is an application that helps you keep your files and folders always updated. You can easily sync your documents, music or pictures to have their latest versions everywhere. Synkron provides an easy-to-use interface and has lot of features. Moreover, it is free, open-source and cross-platform.
> 
> 
> 

[![screenshot](https://i.stack.imgur.com/V7spA.png)](https://i.stack.imgur.com/V7spA.png)
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/)