erigon-pulse/cmd/downloader/recompress.sh

21 lines
458 B
Bash
Raw Normal View History

dir=$1
2022-04-12 08:03:44 +00:00
files=$(ls $dir/snapshots | grep -v tor | grep seg | sort -n -t$'-' -k1)
for file in $files
do
2022-04-12 08:01:25 +00:00
from=$dir/snapshots/$file
to=$dir/snapshots/$file.new
echo "file: $file"
./build/bin/erigon_old snapshots uncompress $from | ./build/bin/erigon snapshots compress $to --datadir=$dir
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
done