test006 - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
test006 (611B)
---
1 #!/bin/sh
2 set -ex
3
4 SHA1SUM=${SHA1SUM:-sha1sum}
5
6 keyfile=`mktemp -u`
7 repo=`mktemp -u`
8 data=`mktemp`
9 dd if=/dev/urandom of="$data" bs=1M count=64
10 ./dup-keygen "$keyfile"
11 ./dup-init -E XChaCha20-Poly1305 -k "$keyfile" "$repo"
12 ./dup-pack -k "$keyfile" -r "$repo" snap0 < "$data"
13 ./dup-gc -k "$keyfile" "$repo"
14 ./dup-rm -k "$keyfile" -r "$repo" snap0
15 ./dup-pack -k "$keyfile" -r "$repo" snap0 < "$data"
16 ./dup-gc -k "$keyfile" "$repo"
17 sum0=`$SHA1SUM < "$data" | awk '{print $1}'`
18 sum1=`./dup-unpack -k "$keyfile" -r "$repo" snap0 | $SHA1SUM | awk '{print $1}'`
19 [ "$sum0" = "$sum1" ]
20 rm -rf "$keyfile" "$repo" "$data"