2022-04-12 15:22:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2022-04-07 06:26:14 +00:00
|
|
|
|
|
|
|
dir=$1
|
2022-04-13 15:29:44 +00:00
|
|
|
files=$(ls $dir/snapshots | grep -v old | grep -v tor | grep seg | sort -n -t$'-' -k1)
|
2022-04-07 06:26:14 +00:00
|
|
|
for file in $files
|
|
|
|
do
|
2022-04-12 08:01:25 +00:00
|
|
|
from=$dir/snapshots/$file
|
|
|
|
to=$dir/snapshots/$file.new
|
2022-04-07 06:26:14 +00:00
|
|
|
echo "file: $file"
|
|
|
|
|
2022-04-08 04:02:44 +00:00
|
|
|
./build/bin/erigon_old snapshots uncompress $from | ./build/bin/erigon snapshots compress $to --datadir=$dir
|
2022-04-07 06:26:14 +00:00
|
|
|
a=$(du -h $from | awk '{print $1;}')
|
|
|
|
b=$(du -h $to | awk '{print $1;}')
|
|
|
|
echo "size: $a -> $b"
|
2022-04-12 08:01:25 +00:00
|
|
|
mv $from $from.old
|
|
|
|
mv $from.new $from
|
|
|
|
|
2022-04-07 06:26:14 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|