From a0727c890199207f74a0e4ef9bbdf7d4ac8086a6 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 24 Jan 2024 15:22:53 +0300 Subject: [PATCH] Archive : Fix paths. --- .config/bash/module/Archive.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/bash/module/Archive.sh b/.config/bash/module/Archive.sh index 65ab16c..b55d6b4 100644 --- a/.config/bash/module/Archive.sh +++ b/.config/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/du -sb ${target} | awk '{print $1}') | xz -9e | tee ${name}.txz | sha1sum | cut -d\ -f1) + local hash=$(tar ${exclude} -c ${target} | pv -s $(du -sb ${target} | awk '{print $1}') | xz -9e | tee ${name}.txz | sha1sum | cut -d\ -f1) # append hash to target name. local new_name="${name}_${date}-${hash}.txz" @@ -57,7 +57,7 @@ function archive_mt() { local mem_limit=$((mem_free*3/4)) # create archive. - local hash=$(tar ${exclude} -c ${target} | pv -s $(/usr/bin/du -sb ${target} | awk '{print $1}') | xz -9e --threads=0 --memlimit=${mem_limit}MiB | tee ${name}.txz | sha1sum | cut -d\ -f1) + local hash=$(tar ${exclude} -c ${target} | pv -s $(du -sb ${target} | awk '{print $1}') | xz -9e --threads=0 --memlimit=${mem_limit}MiB | tee ${name}.txz | sha1sum | cut -d\ -f1) # append hash to target name. local new_name="${name}_${date}-${hash}.txz" @@ -89,7 +89,7 @@ function archive_fast() { [[ -f "${target}/.archiveignore" ]] && exclude="--exclude-from=${target}/.archiveignore" # create archive. - local hash=$(tar ${exclude} -c "${target}" | pv -s $(/usr/bin/du -sb "${target}" | awk '{print $1}') | gzip -1 | tee "${name}".tgz | sha1sum | cut -d\ -f1) + local hash=$(tar ${exclude} -c "${target}" | pv -s $(du -sb "${target}" | awk '{print $1}') | gzip -1 | tee "${name}".tgz | sha1sum | cut -d\ -f1) # append hash to target name. local new_name="${name}_${date}-${hash}.tgz"