From 11aaaa5c9ad98e9a33964d8272b30895bc68e06e Mon Sep 17 00:00:00 2001 From: simono41 Date: Tue, 3 Oct 2017 21:40:13 +0200 Subject: [PATCH] compress --- compress.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 compress.sh diff --git a/compress.sh b/compress.sh new file mode 100755 index 0000000..5e379f1 --- /dev/null +++ b/compress.sh @@ -0,0 +1,25 @@ +#!/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 + echo "./compress.sh make/restore input/output" +fi