From a374e6b68fcb29023fd3e025c7104695c2880d53 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Fri, 22 Mar 2024 01:53:55 +0000 Subject: [PATCH] Archive : Specify single thread for archive and xz. --- module/common/bash/module/Archive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/common/bash/module/Archive.sh b/module/common/bash/module/Archive.sh index 1e16a9a..3847094 100644 --- a/module/common/bash/module/Archive.sh +++ b/module/common/bash/module/Archive.sh @@ -22,7 +22,7 @@ function archive() { [[ -f "${target}/.archiveignore" ]] && exclude="--exclude-from=${target}/.archiveignore" # create archive. - local hash=$(tar ${exclude} -c ${target} | pv -s $(/usr/bin/env du -sb ${target} | awk '{print $1}') | xz -9e | tee ${name}.txz | sha1sum | cut -d\ -f1) + local hash=$(tar ${exclude} -c ${target} | pv -s $(/usr/bin/env du -sb ${target} | awk '{print $1}') | xz -9e --threads=1 | tee ${name}.txz | sha1sum | cut -d\ -f1) # append hash to target name. local new_name="${name}_${date}-${hash}.txz" @@ -176,7 +176,7 @@ function archive_xz() { _archive_check "${target}" || return 1 # Recompress. - local hash=$(pv "${target}" | gzip -d | xz -9e | tee "${tmp}" | sha1sum | cut -d\ -f1) + local hash=$(pv "${target}" | gzip -d | xz -9e --threads=1 | tee "${tmp}" | sha1sum | cut -d\ -f1) # Rename. local new_name="${data[0]}_${data[1]}-${hash}.txz"