How to show rsync progress
Answer: Use the --progress
option
rsync --progress [source] [destination]
For each file being copied you'll get the following info, updated along the way:
[file size] [current progress %] [transfer speed] [time remaining]
Here's an example output:
test_file1
14708627 100% 233.73MB/s 0:00:01 (xfer#1, to-check=1/2)
test_file2
459243520 42% 72.68MB/s 0:00:08
As a shortcut, you can use -P
instead of --progress
, but with a little caveat.
Have in mind that -P
is equivalent to --progress --partial
. In most cases, this is just fine, since including --partial
tells rsync
to keep incomplete files at the destination in case the transfer is interrupted. To quote man pages:
--partial
By default, rsync will delete any partially transferred file if the
transfer is interrupted. In some circumstances it is more desirable to
keep partially transferred files. Using the --partial option tells
rsync to keep the partial file which should make a subsequent transfer
of the rest of the file much faster.
Human-readable numbers with -h
The first column in the progress output shows the file size, and by default, it is in bytes. In order to display file sizes in a more human-readable format, you can use -h
or --human-readable
.
rsync --progress -h [source] [destination]
Using -h
gives us the following output (note the file size in megabytes):
test_file1
14.71M 100% 237.69MB/s 0:00:00 (xfer#1, to-check=1/2)
test_file2
904.92M 84% 215.90MB/s 0:00:00
File transfer stats with --stats
If we call rsync
with the --stats
option, at the end of the transfer we get helpful stats about the overall transfer process. Here's an example:
rsync --stats --progress -h [source] [destination]
test_file1
14.71M 100% 82.82MB/s 0:00:00 (xfer#1, to-check=1/2)
test_file2
1.07G 100% 74.62MB/s 0:00:13 (xfer#2, to-check=0/2)
Number of files: 2
Number of files transferred: 2
Total file size: 1.09G bytes
Total transferred file size: 1.09G bytes
Literal data: 1.09G bytes
Matched data: 0 bytes
File list size: 41
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 1.09G
Total bytes received: 64
sent 1.09G bytes received 64 bytes 75.07M bytes/sec
total size is 1.09G speedup is 1.00