I've recently had to copy a lot of data from one server to the other. I knew that you could diplay the progress in rsync with the --progress option. However this gives you the data for each file you're copying which fills the terminal with unnecessary "spam".

In search of a better option I've found out that rsync has another progress option. --info=progress2 This gives you the overall progress of the whole copy process.

To show you the difference rsync --progress -a test_source test_target produces:

[user@hostname ~]$ rsync --progress -a test_source/ test_target/
sending incremental file list
              0 100%    0.00kB/s    0:00:00 (xfr#1, to-chk=4/6)
              0 100%    0.00kB/s    0:00:00 (xfr#2, to-chk=3/6)
              0 100%    0.00kB/s    0:00:00 (xfr#3, to-chk=2/6)
              0 100%    0.00kB/s    0:00:00 (xfr#4, to-chk=1/6)
              0 100%    0.00kB/s    0:00:00 (xfr#5, to-chk=0/6)

and rsync --info=progress2 -a test_source test_target produces

[user@hostname ~]$ rsync --info=progress2 -a test_source/ test_target/
              0 100%    0.00kB/s    0:00:00 (xfr#5, to-chk=0/6)

This can as well come in handy if you want progress stats when copying local files.

Next Post Previous Post