Se o servidor local e o remoto suportarem a capacidade de criar links físicos, você poderá usar esse truque para obter o que deseja. O método é discutido nesta postagem do blog, intitulada: Detecting File Moves & Renomeia com o Rsync .
Etapas gerais
-
sincronização normal
$ rsync -avHP --delete-after ~/family/Photos remotebox:backups
-
agora faça algumas alterações
$ cd ~/family $ cp -rlp Photos Photos-work
The cp is done very quickly when its switches are: copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)
Do the reorganization in the Photos-work directory: you can rename, move, add and delete any files. But DON’T TOUCH the tree in Photos, this directory (with the same sets of paths on both machines), will allow rsync to quickly find the data to clone under Photos-work on the remote machine.
-
Quando você terminar de se reorganizar, execute isso:
$ rsync -avHP --delete-after --no-inc-recursive ~/family/Photos ~/family/Photos-work remotebox:backups
By transferring both trees at once and by turning off incremental recursion, rsync collects all hard-links before it transfers anything. It is now able to reconstruct Photos-work on the remote machine IN SECONDS. Next you finalize by:
$ mv Photos Photos-OLD $ mv Photos-work Photos
And you do this on both local and remote machines. You can keep the OLD directory around for as long as you want, the space it uses is usually negligible.