Advertisement
v1ral_ITS

Using pv as progress value with yad [.targz current directo]

Aug 5th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.30 KB | None | 0 0
  1. #!/bin/bash
  2. if [[ $UID -eq 0 ]]; then
  3. (tar cf - . \
  4. | pv -n -s $(du -sb . | awk '{print $1}') \
  5. | gzip -9 > out.tgz) 2>&1 \
  6. | yad --width 300 --height 100 --title "Progress .tgz Current Directory" --progress 'Progress' 7 70
  7. else
  8. yad --title "Sorry" --text-info --entry "This script must be ran as root"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement