Skip to content

Instantly share code, notes, and snippets.

@anthonygclark
Created November 13, 2012 05:00
Show Gist options
  • Save anthonygclark/4063993 to your computer and use it in GitHub Desktop.
Save anthonygclark/4063993 to your computer and use it in GitHub Desktop.
dialog tgz
#!/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