1

I'm trying to change the output position of a file transfer made with rsync, as shown below:

rsync -zvh --progress ubuntu-19.10-desktop-amd64.iso /home/lnxusr/Downloads/ 

From this:

ubuntu-19.10-desktop-amd64.iso
        144.67M   5%   34.50MB/s    0:01:05

To this:

ubuntu-19.10-desktop-amd64.iso
144.67M   5%   34.50MB/s    0:01:05

However, when I pipe it to | sed -u 's/[^\s]+//', I only get the static output which is:

ubuntu-19.10-desktop-amd64.iso

I tried the answer suggested here to turn off the buffering process with stdbuf -o0 but got the same result as before.

Anyone knows this kind of output manipulation? or if is it even possible to position this output?

thsdsdev
  • 431
  • 3
  • 11

1 Answers1

0

Another answer might provide a better way:

rsync has a --info option that can be used to not only output the current progress, but also the transfer rate and elapsed time:

--info=FLAGS            fine-grained informational verbosity

The explanation of how to use it comes under the -P option in the man page:

-P     The -P option is equivalent to --partial --progress.  Its purpose is to
       make it much easier to specify these two options for a long transfer that
       may be interrupted.

       There is also a --info=progress2 option that outputs statistics based on
       the whole transfer, rather than individual files.  Use this flag
       without  out‐putting  a  filename  (e.g. avoid -v or specify --info=name0)
       if you want to see how the transfer is doing without scrolling the screen 
       with  a  lot  of names.   (You  don’t  need  to specify the --progress
       option in order to use --info=progress2.)

So trying using:

rsync -zvh --info=progress2 --info=name0 ubuntu-19.10-desktop-amd64.iso /home/lnxusr/Downloads/

Notes:

  • This gives the progress of the entire transfer, not for individual filenames.
  • I do not have your source file nor target directory to test on my system.