I have a script that creates a backup for me. I would like to keep track of its progress, so I would like to see, every second (or so), the time elapsed and the size of the backup file. I manage to get the size of the backup file, but I cannot get the elapsed time to work.
This is what i have:
1. To create the backup:
#!/bin/sh
tarfile=$TMPDIR/fullhd.tgz
every 1 sys_echosize $tarfile &
every_pid=$!
tar cfz $tarfile .
kill $every_pid
2. The "every" script performs a cmd every few seconds:
#!/bin/sh
t=$1
shift
while true ; do
$*
sleep $t
done
3. The "sys_echosize" is as follows:
#!/bin/sh
echo -e -n " " `du -h $1` "\r"
Nice, isn't it?!?

But not finished, as I would like to have the time elapsed of the tar command...
Any help would be appreciated!!!
Regards,
Robin...