rsync | howto sync moved files
mouse 244 · person cloud · link
Last update
2018-06-13
2018
06-13
« — »

Rsync recognize hard-links so if both hosts support them you can do this:

1
2
3
4
5
6
7
8
rsync -avHP --delete-after src dest # initial sync

cp -rlp src src-orig # make hard links of everything
... # organize src folder
rsync -avHP --delete-after --no-inc-recursive src src-orig dest

rm -rf src-orig
rsync -avHP --delete-after src dest # delete old hard links

Source: Detecting File Moves & Renames with Rsync