Im in the process of writing a shell script for enabling an IT operations to run archiving.We use netbackup. The script is complete, though there is one bit that i need help on. Im trying to have a progess bar for the procedure.I have gone through the man page of the command in question and there was no hint of it. Following is the code snippet
Progress bar dependent on the process status..? I don't think so we can easily configure this..
But if you know the average duration of time or if you can have some indicator that will show how much time it will need more.
Better way find the average time and set the sleep accordingly. And check the script status. And display progress bar..
spinner()
{
local pid=$1
local delay=10
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep -E "$pid|bpbkar32")" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf "Archiving in Progress .. \b\b\b\b"
}
snipper $!
How ever what happens is when the command bparchive initiates it invokes a different command (bpbkar32) and not be seen in the ps listing.