Archive : Fix paths.

This commit is contained in:
Dmitry Voronin 2024-01-24 15:22:53 +03:00
parent f0a4d6ba78
commit a0727c8901

View file

@ -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"