Save as fsiomon.sh, chmod +x fsiomon.sh, and then use it like this:
./fsiomon.sh /somefile.bz2
It will tell you (roughly) how fast the file is growing. I wrote this to determine what kind of throughput I get when moving files over network mounted filesystems.
#!/bin/sh
FILE=$1
if [ ! -e ${FILE} ]; then
exit $(false)
fi
function get_size() {
stat -c %s $1
}
size_a=$(get_size ${FILE})
sleep 1
size_b=$(get_size ${FILE})
if [ $size_b -gt $size_a ]; then
TRANS=$(($size_b - $size_a))
if [ $TRANS -gt 1048576 ]; then
OUT=$(($TRANS / 1048576))
UNIT="MB/s"
elif [ $TRANS -gt 1024 ]; then
OUT=$(($TRANS / 1024))
UNIT="KB/s"
else
OUT=$TRANS
UNIT="Bytes/s"
fi
echo "${FILE} ${TRANS} ${OUT} ${UNIT}"
else
echo "${FILE} not growing"
fi