Rewrite targz function

This commit is contained in:
Jan 2022-10-11 13:42:09 +02:00
parent 2d298d20d7
commit a6df3fae57
2 changed files with 14 additions and 1 deletions

View File

@ -61,7 +61,6 @@ alias bcp='rsync -avzuh --progress --partial'
alias random32="echo $(date +%s | md5sum | head -c 32)"
# tar
alias targz='tar -czvf'
alias untargz='tar -xzvf'
# (macOS) start Firefox Profile manager

View File

@ -19,6 +19,20 @@ if [[ ! -x `which sha256sum` ]]; then
}
fi
# Tar.gz with GZIP or PIGZ
function targz() {
if [ -z "$1" ]; then
echo "usage: targz filename.tar.gz directory"
return
fi
if [[ ! -x `which pigz` ]]; then
tar -czf $1 $2
echo "gzip"
else
tar -c $2 | pigz > $1
echo "pigz"
fi
}
# pushover notification
function pushover() {