Linux – Rsync that handles moves sensibly

linuxrsyncsynchronizationunison

I've been successfully using rsync to synchronize my home directories between my laptop and my netbook (both using ext4 with Linux). My only problem with it is that every now and then I like to completely reorganize certain directories, and rsync sees this as deletions and creation of new files, which makes it very slow and inefficient.

Does anybody know of a good piece of software that handles file moves well?

I've found that unison should be capable of this, but it doesn't seem to work in practice.
I tested unison by synchronizing two local directories, each with a large file in it, and it still detected my move as a deletion+creation and was in effect even slower than rsync.

Moreover, if I remember correctly from my looking at unison's source code a couple of months ago, it tried to do something like doing sha sums—and I don't want my ideal solution to do sha sums—that's too slow on large files/directories. I'd like something that notices things like:

"
The last source counterpart of this file seems to have been deleted and there's a new file elsewhere in the source directory tree that has the same mdate, size, and inode number, so I'm just going to assume that this was a move and move its target counterpart accordingly instead of doing a delete+copy.
"

It's important to me that I be able to sync these machines quickly.

Any suggestions?

Best Answer

You should take a look at rdiff-backup it does rsync underneath, but with the additional intelligence that you require (and it makes incremental backups capable of rolling back, but you can configure to switch that off).

The latest release is old (2009), but that is a sign of stability.

Related Question