aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'snapshots-create.sh')
-rwxr-xr-xsnapshots-create.sh10
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)