Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting rsync --stats output to GB? [closed]

Tags:

bash

rsync

When using --stats with rsync, you get a report at the bottom of the transfer log.

Number of files: 211009
Number of files transferred: 410
Total file size: 903119614118 bytes
Total transferred file size: 9046197739 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 5864077
File list generation time: 23.204 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 5865513
Total bytes received: 1441

I would like to convert Total file size and Total transferred file size in place to GB, so it becomes

Number of files: 211009
Number of files transferred: 410
Total file size: 903 GB
Total transferred file size: 9 GB
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 5864077
File list generation time: 23.204 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 5865513
Total bytes received: 1441

Question

How should that be done?

like image 641
Sandra Schlichting Avatar asked Sep 20 '12 11:09

Sandra Schlichting


1 Answers

rsync --stats -h /your /paths --and --options

-h stands for human readable.

like image 155
keks Avatar answered Sep 25 '22 09:09

keks