rsync para importar / exportar delta-transfer ou resultado de cópia incremental

2

Meu cenário é distribuir vários arquivos GB de um servidor de armazenamento temporário para dezenas de servidores de destino idênticos. Desde rsync pode fazer delta-transferência ou cópia incremental, eu queria saber quando o arquivo rsync para 1st dest servidor, pode rsync exportar o resultado de transferência delta? E use import esse resultado para rsync'ing para o resto dos servidores de destino. Nesse caso, o servidor de temporariedade pode economizar tempo de CPU ao recalcular a transferência delta. Isso é possível?

Number of files: 160
Number of files transferred: 49
Total file size: 2993222827 bytes = 2854 MB
Total transferred file size: 1847285024 bytes =1761 MB
Literal data: 69543644 bytes = 66 MB
Matched data: 1777741380 bytes = 1695 MB
File list size: 3088
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 1256178
Total bytes received: 70240527 = 67 MB

sent 1256178 bytes  received 70240527 bytes  182157.21 bytes/sec =
0.17 MB/s total size is 2993222827 speedup is 41.87
    
por Stan 25.04.2011 / 03:18

1 resposta

6

Sim. É para isso que serve o modo batch do rsync. Na página do manual:

Batch mode can be used to apply the same set of updates to many identical systems. Suppose one has a tree which is replicated on a number of hosts. Now suppose some changes have been made to this source tree and those changes need to be propagated to the other hosts. In order to do this using batch mode, rsync is run with the write-batch option to apply the changes made to the source tree to one of the destination trees. The write-batch option causes the rsync client to store in a "batch file" all the information needed to repeat this operation against other, identical destination trees.

Generating the batch file once saves having to perform the file status, checksum, and data block generation more than once when updating multiple destination trees. Multicast transport protocols can be used to transfer the batch update files in parallel to many hosts at once, instead of sending the same data to every host individually.

To apply the recorded changes to another destination tree, run rsync with the read-batch option, specifying the name of the same batch file, and the destination tree. Rsync updates the destination tree using the information stored in the batch file.

Um exemplo:

$ rsync --write-batch=foo -a host:/source/dir/ /adest/dir/
$ scp foo* remote:
$ ssh remote ./foo.sh /bdest/dir/
    
por 25.04.2011 / 05:14