diff --git a/scripts/bin/compress-zst-gpg b/scripts/bin/compress-zst-gpg new file mode 100755 index 0000000..09275cb --- /dev/null +++ b/scripts/bin/compress-zst-gpg @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +level="${level:-19}" + +cmd=$(which tar) +if command -v "gtar" &> /dev/null; then + cmd=$(which gtar) +fi +echo "Using $cmd" + +name="$1".tar.zst.gpg +shift +echo "Output to $name" + +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 -cf - "$@" | gpg --symmetric --cipher-algo aes256 -o "$name" \ No newline at end of file