From e9febc5de3f96bad8f517c0c98f34a8227c23a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 7 Apr 2018 14:51:05 +0100 Subject: [PATCH] add large files compression script --- tools/compress-large-dir | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tools/compress-large-dir diff --git a/tools/compress-large-dir b/tools/compress-large-dir new file mode 100755 index 00000000..026549ac --- /dev/null +++ b/tools/compress-large-dir @@ -0,0 +1,16 @@ +#!/bin/bash +set -eo pipefail + +if [ -z $1 ]; then + echo "Usage: $0 dir" + exit 1 +fi + +dir="${1%/*}" + +if [ ! -e $dir ]; then + echo "$dir doesn't exist" + exit 1 +fi + +benice tar -cf - $dir | pv -ptabI -s $(du -sb $dir | awk '{print $1}') | pixz -9 > $dir.tar.xz