I want to compare two large binary files which are stored on different Linux machines with limited bandwidth between them and then back up only the blocks which differ – on the command line. To simplify the task, we can assume the files are not going to change during the comparison process, and the files are the same size.
This is almost like what I believe
rsync does, only I don't want to modify the target file – I want to keep diffs which I can apply to the base image so I can recreate a copy at various points (ie when the diffs are taken).
I'm also aware of
xdelta, but that appears to only compare files on the same machine.
The "process" I roughly envisage (hopefully all done by a script/program) might be -
- (On each machine) produce a list of hashes for each block.
- Compare the 2 sets of hashes.
- Produce a file which pulls only the changed blocks in the source in such a way as they can be "merged" back with the target file.
Is anyone aware of a program, script or elegant method to do this without me having to cut code?