erigon-pulse/cmd/downloader/recompress.sh

19 lines
472 B
Bash
Raw Normal View History

dir=$1
files=$(ls $dir/snapshots | grep tr | grep -v tor | grep seg | sort -n -t$'-' -k1)
for file in $files
do
2022-04-12 07:51:45 +00:00
mv $dir/snapshots/$file $dir/snapshots/$file.old
from=$dir/snapshots/$file.old
to=$dir/snapshots/$file
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"
done