shell-scripte-code/compress.sh

26 lines
382 B
Bash
Raw Normal View History

2017-10-03 21:40:13 +02:00
#!/bin/bash
set -ex
archiv=$2
if [ "make" == "$1" ]; then
while (( "$(expr $# - 2)" ))
do
dateien="$3 ${dateien}"
shift
done
tar -cf ${archiv}.tar ${dateien}
pixz ${archiv}.tar ${archiv}.tar.pxz
elif [ "restore" == "$1" ]; then
pixz -d ${archiv} ${archiv/.pxz*}
tar -xf ${archiv/.pxz*}
else
2017-10-03 21:44:32 +02:00
echo "./compress.sh make/restore archivname input/output"
2017-10-03 21:40:13 +02:00
fi