Created
November 13, 2012 05:00
-
-
Save anthonygclark/4063993 to your computer and use it in GitHub Desktop.
dialog tgz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dialog progress for targz | |
# Taken from `man pv` | |
[ $# -lt 2 ] && echo "Supply output filename.tgz and list of files" && exit 1 | |
out=$1 | |
shift; files=$@ | |
(tar cf - $files \ | pv -n -s $(du -sbc $files | grep 'total' | awk '{print $1}') \ | |
| gzip -9 > $out) 2>&1 | dialog --gauge 'Progress' 7 70 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment