View Single Post
Old 04-29-2019, 01:22 PM   #17
BloodRagg
Zealot
BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.BloodRagg ought to be getting tired of karma fortunes by now.
 
BloodRagg's Avatar
 
Posts: 128
Karma: 842196
Join Date: Feb 2019
Device: none
Quote:
Originally Posted by NiLuJe View Post
busybox's tar doesn't support checkpoints, and/or isn't actually there on some target platforms, and/or doesn't support something else that I can't remember OTOH.
If its only the checkpoints this could suffice with some modification.
Code:
untar_progress(){
  local total=$(tar -ztf "$1" |wc -l)
  local step=$((total/100));[ $step -gt 1 ] || step=1
  tar -zxvf $@ | awk -v total=$total -v step=$step \
    'BEGIN {ORS="\n"} {if(NR%step==0) system("fbink -qe -y5 -P" int(NR*100/total))}'
}

untar_progress file.tar
I always forget its multiplatform
BloodRagg is offline   Reply With Quote