|
|
tdup-migrate - dedup - data deduplication program |
|
|
 |
git clone git://bitreich.org/dedup/ git://hg6vgqziawt5s4dj.onion/dedup/ (git://bitreich.org) |
|
|
 |
Log |
|
|
 |
Files |
|
|
 |
Refs |
|
|
 |
Tags |
|
|
 |
README |
|
|
 |
LICENSE |
|
|
|
--- |
|
|
|
tdup-migrate (432B) |
|
|
|
--- |
|
|
|
1 #!/bin/sh |
|
|
|
2 # |
|
|
|
3 # Migrate an old dedup repo to a new one. |
|
|
|
4 # This is useful when there is an ABI break |
|
|
|
5 # in the deduplication repository file format. |
|
|
|
6 |
|
|
|
7 set -e |
|
|
|
8 |
|
|
|
9 usage() |
|
|
|
10 { |
|
|
|
11 echo usage: dup-migrate old-repo new-repo >&2 |
|
|
|
12 exit 1 |
|
|
|
13 } |
|
|
|
14 |
|
|
|
15 if [ ! "$#" -eq 2 ] |
|
|
|
16 then |
|
|
|
17 usage |
|
|
|
18 fi |
|
|
|
19 |
|
|
|
20 oldrepo="$1" |
|
|
|
21 newrepo="$2" |
|
|
|
22 |
|
|
|
23 dup-init "$newrepo" |
|
|
|
24 dup-list-old "$oldrepo" | awk '{print $1}' | while read id |
|
|
|
25 do |
|
|
|
26 dup-unpack-old "$id" "$oldrepo" | dup-pack "$newrepo" |
|
|
|
27 done |
|
|
|
28 sync |
|