For some reason I do this. I start a large file transfer or backup and then I want to know how far it's got, percent complete.
So in a new terminal I write one of these:
Pretty form:
It's going to take a long time. However, as a software engineer, it is not a complete waste of 20 minutes writing that one-liner to tell me that of course
So in a new terminal I write one of these:
Bash:
root@pve:~# while /bin/true; do src=$(du -xms mnt | cut -f 1); dest=$(du -xms mnt2|cut -f 1); echo $(( $dest / ( $src / 100 )))% - $(( $src - $dest ))MB to g
o ${src}MB total, ${dest}MB completed; sleep 5; done
27% - 614279MB to go 852930MB total, 238651MB completed
28% - 613359MB to go 852930MB total, 239571MB completed
28% - 612524MB to go 852930MB total, 240406MB completed
28% - 611666MB to go 852930MB total, 241264MB completed
28% - 610784MB to go 852930MB total, 242146MB completed
28% - 609929MB to go 852930MB total, 243001MB completed
Pretty form:
Bash:
while /bin/true
do
src=$(du -xms mnt | cut -f 1);
dest=$(du -xms mnt2|cut -f 1);
echo -n $(( $dest / ( $src / 100 )))% -
echo -n $(( $src - $dest ))MB to go
echo ${src}MB total, ${dest}MB completed;
sleep 5;
done
It's going to take a long time. However, as a software engineer, it is not a complete waste of 20 minutes writing that one-liner to tell me that of course