Wednesday 27 April 2022

Re: pv (a pipeline progress indicator) in main?

Hi Bryce,

pv looks like a really good idea to me. Kudos to Andrew Wood for his code and to the people promoting this tool.

Using pv at the beginning of a pipe provides full information and an estimate of time remaining. This is really useful.

Using pv to display the progress of a tar command is a little redundant. Because tar and time can already do that for you. I ripped this out of a script file of mine I've used in the past.

echo "$0" Running in "$PWD"
echo Creating tar file: $1
/usr/bin/time -f "%E mins:secs " tar --checkpoint=4000 --checkpoint-action=ttyout='%{%Y-%m-%d %H:%M:%S}t (%d sec): #%u, %T%*\r' -czf  "$@"

OTOH, using pv is a lot simpler.

BW,

Ian

--
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/