Syncing directories in both directions with rsync

You want bi-directional sync. Take a look at unison, which does this: http://www.cis.upenn.edu/~bcpierce/unison/

For example, on Debian/Ubuntu:

$ sudo apt-get install unison
$ unison MAC/ LINUX/

If you have trouble with permissions (example ext4 -> FAT):

$ unison -perms 0 vlc-2.2.0/ /media/sf_vlc/vlc
Contacting server...
Looking for changes
Reconciling changes

vlc-2.2.0      vlc                
new dir  ---->            /  [f] 

Proceed with propagating updates? [] y
Propagating updates

It has been claimed that rsync was not recommended for two-way sync by its developers, but a source for this statement is lacking.

The already recommended unison utility will be a better solution for you.

Also keep in mind that you probably have to deal with a lot of Mac specific HFS+ stuff when using rsync. So be sure to use a properly patched rsync3 on the Mac or expect problems with modification dates (when using the Mac OS X provided rsync 2.6.9.) If you don't know how to build a properly patched rsync 3 for the Mac, get mlbackup which includes just that. (Full disclosure: I am the author of mlbackup.) Get it from github and be sure to download the full package from the downloads. (The mlbackup repo does not include rsync 3 which you want in this case.) http://github.com/MacLemon/mlbackup


You should also take a look at csync, which is open source and offers native bi-directional syncing.

FYI - as far as I know - csync is developed by people from the Samba team. And knowing that the Samba team also developed rsync, I take this as a token of quality.