Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rdiff file example
# $ apt install rdiff
# $ rdiff --help
# Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]]
# [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]
# [OPTIONS] patch BASIS [DELTA [NEWFILE]]
# Options:
# -v, --verbose Trace internal processing
# -V, --version Show program version
# -?, --help Show this help message
# -s, --statistics Show performance statistics
# Delta-encoding options:
# -b, --block-size=BYTES Signature block size
# -S, --sum-size=BYTES Set signature strength
# --paranoia Verify all rolling checksums
# IO options:
# -I, --input-size=BYTES Input buffer size
# -O, --output-size=BYTES Output buffer size
# create signature for old file
rdiff signature old-file signature-file
# create delta using signature file and new file
rdiff delta signature-file new-file delta-file
# generate new file using old file and delta
rdiff patch old-file delta-file gen-file
# test
diff -s gen-file new-file
# Files gen-file and new-file are identical
@amworsley

This comment has been minimized.

Copy link

@amworsley amworsley commented Feb 1, 2021

  • Note signature is a command to generate a signature file - wasn't obvious to me
  • e.g. An example
# Generate signature into sigfile.bin
rdiff signature share/bigbinaryfile.img4 sigfile.bin
# Generate delta from generated signature file and other file
rdiff delta sigfile.bin the-other-bigbinaryfile.img4 delta.rdiff
# Patch the original file to the new file with delta.rdiff
rdiff patch share/bigbinaryfile.img4 delta.rdiff share/bigbinaryfile.img4-new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment