bash : archive : show progress for hashes, too.
This commit is contained in:
parent
a39b8c86c4
commit
9dae45ccd3
|
@ -32,7 +32,7 @@ archive()
|
||||||
tar -c "${target}" | pv -s $(du -sb "${target}" | awk '{print $1}') | xz -9e > "${target%/*}".txz
|
tar -c "${target}" | pv -s $(du -sb "${target}" | awk '{print $1}') | xz -9e > "${target%/*}".txz
|
||||||
|
|
||||||
# append hash to target name.
|
# append hash to target name.
|
||||||
mv "${target%/*}".txz "${target%/*}"_${date}-$(sha1sum "${target%/*}".txz | cut -d\ -f1).txz
|
mv "${target%/*}".txz "${target%/*}"_${date}-$(pv "${target%/*}".txz | sha1sum | cut -d\ -f1).txz
|
||||||
|
|
||||||
# report success.
|
# report success.
|
||||||
echo -e "${color_green}${status}: done.${color_default}"
|
echo -e "${color_green}${status}: done.${color_default}"
|
||||||
|
@ -67,7 +67,7 @@ archive_fast()
|
||||||
tar -c "${target}" | pv -s $(du -sb "${target}" | awk '{print $1}') | gzip -1 > "${target%/*}".tgz
|
tar -c "${target}" | pv -s $(du -sb "${target}" | awk '{print $1}') | gzip -1 > "${target%/*}".tgz
|
||||||
|
|
||||||
# append hash to target name.
|
# append hash to target name.
|
||||||
mv "${target%/*}".tgz "${target%/*}"_${date}-$(sha1sum "${target%/*}".tgz | cut -d\ -f1).tgz
|
mv "${target%/*}".tgz "${target%/*}"_${date}-$(pv "${target%/*}".tgz | sha1sum | cut -d\ -f1).tgz
|
||||||
|
|
||||||
# report success.
|
# report success.
|
||||||
echo -e "${color_green}${status}: done.${color_default}"
|
echo -e "${color_green}${status}: done.${color_default}"
|
||||||
|
|
Reference in a new issue