Files
zshrc/scripts/bin/compress-zst
T
2022-12-24 04:24:40 -05:00

13 lines
356 B
Bash
Executable File

#!/usr/bin/env bash
level="${level:-15}"
cmd=$(which tar)
if command -v "gtar" &> /dev/null; then
cmd=$(which gtar)
fi
echo "Using $cmd"
cores=$(python3 -c "import os; print(os.cpu_count())")
echo "Starting ZSTD compression with $cores cores and level $level"
"$cmd" -I "zstd -T$cores -$level" --checkpoint=.1024 --totals --totals=SIGUSR1 -c -f "$@"