add large files compression script
This commit is contained in:
parent
b22724fc0e
commit
e9febc5de3
1 changed files with 16 additions and 0 deletions
16
tools/compress-large-dir
Executable file
16
tools/compress-large-dir
Executable file
|
@ -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
|
Loading…
Reference in a new issue