This is an easy script that lets you countdown after having checked the size of a folder.
I used this to monitor the state of a file transfer with lots of small file and no proper progress bar.
Credit for the counter go to dsmsk80(https://serverfault.com/questions/532559/bash-script-count-down-5-minutes-display-on-single-line#answer-532564)
Inline version (replace interval)
interval=30; while true; do clear; echo du -hs `pwd`/\*; du -hs * ; secs=$interval; while [ $secs -gt 0 ]; do echo -ne "Refresh in $secs seconds\033[0K\r"; sleep 1; : $((secs--)); done; done
As a bash script
#!/bin/bash
interval=0
if [ -z $1 ];
then
interval=30
else
interval=$1
fi
while true; do
clear
echo du -hs `pwd`/*
secs=$interval
while [ $secs -gt 0 ]; do
echo -ne "Refresh in $secs seconds\033[0K\r"
sleep 1
: $((secs--))
done
done