diff --git a/lib/backends/s3.bash b/lib/backends/s3.bash index c39d338..260a509 100644 --- a/lib/backends/s3.bash +++ b/lib/backends/s3.bash @@ -33,6 +33,12 @@ if [[ ! "$OSTYPE" == "darwin"* ]]; then fi BK_TAR_EXTENSION="tar.gz" BK_TAR_EXTRACT_ARGS="-xzf" + + if [[ "${BK_CACHE_COMPRESS_PROGRAM}" == zstd ]]; then + BK_TAR_EXTENSION="tar.zst" + BK_TAR_ARGS=("$BK_TAR_ADDITIONAL_ARGS" --use-compress-program "zstd" -cf) + BK_TAR_EXTRACT_ARGS="--use-compress-program zstd -xf" + fi else BK_TAR_ARGS=("$BK_TAR_ADDITIONAL_ARGS" -cf) fi diff --git a/lib/backends/tarball.bash b/lib/backends/tarball.bash index e3aeb6d..9f61ecf 100644 --- a/lib/backends/tarball.bash +++ b/lib/backends/tarball.bash @@ -34,6 +34,12 @@ if [[ ! "$OSTYPE" == "darwin"* ]]; then fi BK_TAR_EXTENSION="tar.gz" BK_TAR_EXTRACT_ARGS="-xzf" + + if [[ "${BK_CACHE_COMPRESS_PROGRAM}" == zstd ]]; then + BK_TAR_EXTENSION="tar.zst" + BK_TAR_ARGS=("$BK_TAR_ADDITIONAL_ARGS" --use-compress-program "zstd" -cf) + BK_TAR_EXTRACT_ARGS="--use-compress-program zstd -xf" + fi else BK_TAR_ARGS=("$BK_TAR_ADDITIONAL_ARGS" -cf) fi