Rsync batch mode against unsynchronized targets

rsync

I'd like to try rsync in batch mode against a list of target hosts. The assumption is that all target hosts are at state X. I'd go and create the batch file for rsync against a reference host in that list and apply it to the remaining hosts. Big question is: What will happen if one of these remaining hosts is NOT at the same state as the reference host (Which may have happened because it was out of the loop the last time i synchronized all hosts). Will rsync tell me that something wrong happened? Or will it happily apply the batch file, producing garbage on the unsynchronised host? Any experience?

Best Answer

From man rsync

The read-batch option expects the destination tree that it is updating to be identical to the destination tree that was used to create the batch update fileset. When a differ-
ence between the destination trees is encountered the update might be discarded with a warning (if the file appears to be up-to-date already) or the file-update may be attempted
and then, if the file fails to verify, the update discarded with an error. This means that it should be safe to re-run a read-batch operation if the command got interrupted. If you wish to force the batched-update to always be attempted regardless of the file's size and date, use the -I option (when reading the batch). If an error occurs, the destina- tion tree will probably be in a partially updated state. In that case, rsync can be used in its regular (non-batch) mode of operation to fix up the destination tree.