rsync | howto sync moved files
mouse 1516 · person cloud · link
Last update
2020-03-29
2020
03-29
«hard links»

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