Skip to content

Instantly share code, notes, and snippets.

@billywhizz
Forked from jpillora/rdiff-example.sh
Created June 21, 2025 00:10
Show Gist options
  • Save billywhizz/e237aede6ccd3ca44064362a01813c20 to your computer and use it in GitHub Desktop.
Save billywhizz/e237aede6ccd3ca44064362a01813c20 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment