Unfortunately, I cannot test at the moment. However:
Since your problem occurs when you interrupt rsync
, the natural remedy would be a live display of the progress, i.e. to let rsync show the progress while it does its thing. Two approaches to this come to my mind:
rsync
has the --info=
option. To get an idea what you can do with it, execute rsync --info=help
; this will list the flags you can append at the right side. Those flags can have a number appended which designates how verbose the information should be. For example, you could add --info=progress2
or --info=progress3
to your command. Please note that (as I can't test at the moment) I don't know whether it is possible to monitor the whole data transfer size that way (progress seems to relate more to individual files), but IMHO, chances are good.
You should consider using --no-inc-recursive
as well, because this makes rsync
scan first. That way, it knows what to do before starting the actual work, which is the only method to get figures in progress monitoring correct. Otherwise, rsync
would scan while working which could lead to the progress info always telling "90%" ...
Another approach would be to use pv
. Basically, you can use pv
in a pipe between two processes and let it monitor and output the amount of data transferred, and other information, depending on the command line options. A basic usage of pv
in conjunction with rsync
is described here.
However, that example takes the number of files for progress calculation; you need to give the number of files in pv
's command line, which is ugly. But again, you can remedy this by letting rsync
count the number of files before and then start the actual command, giving the result to pv
(instead of a hard-coded number). I am not sure, but I believe that it also should be possible to let pv
count the total amount of data.
Good luck!
rsync
running via ssh? Could you please provide the actual command?