diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2016-01-28 11:09:00 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-01-28 11:09:00 -0800 |
commit | d4c0a6684207b099316e1b5478b2369c7dc01011 (patch) | |
tree | 85599e53ac0d9e6f8392f1c1dd04d3039810c6d7 /snapshots-create.sh | |
parent | snapshots-create: Hide an error that we do not care about (diff) | |
download | mastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.tar.gz mastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.tar.bz2 mastermirror-scripts-d4c0a6684207b099316e1b5478b2369c7dc01011.zip |
Use parallel XZ as well.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'snapshots-create.sh')
-rwxr-xr-x | snapshots-create.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh index 15795be..e2c5e2d 100755 --- a/snapshots-create.sh +++ b/snapshots-create.sh @@ -57,6 +57,14 @@ if [ $BZIP2_PROG == FAIL ]; then echo "Could not find any BZIP2" 1>&2 exit 1 fi +# Find fastest XZ +for XZ_PROG in pixz 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 # working dir cd ${TEMP} @@ -105,7 +113,7 @@ write_time_log "END SIZE SANITY $(date -u)" # 3) create xz tarball write_time_log "START XZ $(date -u)" if [ ! -f "${FILENAME%.*}.xz" ] ; then - xz -k -9 -e "${FILENAME%.*}" || exit $? + ${XZ_PROG} -k -9 -e "${FILENAME%.*}" || exit $? fi write_time_log "END XZ $(date -u)" # end 3) |