Last active
June 25, 2019 06:02
-
-
Save ng-pe/b59eca23c603e70145e4 to your computer and use it in GitHub Desktop.
Tar with percent progress
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 | |
# TAR with progress demo | |
# in this Gist "demo.data" is file to archive | |
total=`du demo.data -B10K --apparent-size | cut -f1` | |
export total=$total | |
BZIP2="-2 -s" tar --checkpoint=1 --checkpoint-action=exec=' printf "%03d/100\r" $((100*$TAR_CHECKPOINT/$total)) ' -cjvf demo.tar.bz2 demo.data | |
# output demo : | |
#./demoscript.sh | |
#demo.data | |
#009/100 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment