1

when doing an rsync -P <source> <destination> it will output transfer speed during the copy, updating every 1 second I believe. But it happens on a single line. How can I save all that text output such that I can plot the transfer speed over time and see what has happened?

I am troubleshooting and moving a 100gb file over X minutes, for a while it bursts at 400 MB/sec, sometimes will drop down to KB/sec; I want to know what happened over those X minutes of transfer how it behaved... Like in Microsoft Windows the popup window that happens during a copy you can visually see highs and lows of the transfer speed.

1 Answer 1

1

The progress line gets repeated with ^M (carriage return) characters after updates. So you can convert ^M to newlines, and if you like, grep out the progress lines:

$ rsync -P <source> <destination> | sed 's/\x0d/\x0a/g' | grep %
         32,768   0%    0.00kB/s    0:00:00
    171,311,104  74%  163.34MB/s    0:00:00
    230,258,742 100%  159.33MB/s    0:00:01 (xfr#1, to-chk=0/1)

or something like this, but at this point you can refine according to your needs:
$ rsync -P <source> <destination> | sed 's/\x0d/\x0a/g' | grep %|tail -n +2|awk '{print NR,$3}'
1 163.34MB/s
2 159.33MB/s

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .