diff options
-rwxr-xr-x | snapshots-create.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh index 600b9c3..a327522 100755 --- a/snapshots-create.sh +++ b/snapshots-create.sh @@ -50,6 +50,7 @@ if [[ ! -e "${UPLOAD}/${DELTA_FILENAME}" ]]; then fi # Find fastest BZIP2 +# lbzip2,pbzip2 default to multiple threads for BZIP2_PROG in lbzip2 pbzip2 bzip2 FAIL ; do [ -n "$(type $BZIP2_PROG 2>/dev/null)" ] && break done @@ -58,13 +59,18 @@ if [ $BZIP2_PROG == FAIL ]; then exit 1 fi # Find fastest XZ -for XZ_PROG in pixz xz FAIL ; do +# pixz appends some data and leads to SIGPIPE +for XZ_PROG in xz FAIL ; do [ -n "$(type $XZ_PROG 2>/dev/null)" ] && break done if [ $XZ_PROG == FAIL ]; then echo "Could not find any xz" 1>&2 exit 1 fi +# Newer 'xz' supports threads as well, but defaults to single-threaded +if $XZ_PROG --help |grep -sq threads=NUM ; then + XZ_PROG="${XZ_PROG} -T 0" +fi # working dir cd ${TEMP} |