Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 将rsync--stats输出转换为GB?_Bash_Rsync - Fatal编程技术网

Bash 将rsync--stats输出转换为GB?

Bash 将rsync--stats输出转换为GB?,bash,rsync,Bash,Rsync,将--stats与rsync一起使用时,您会在传输日志的底部得到一个报告 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 l

--stats
与rsync一起使用时,您会在传输日志的底部得到一个报告

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
我想将
总文件大小
总传输文件大小
就地转换为GB,因此

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
问题

应该怎么做?

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


-h
代表人类可读。

这是一个非常有趣的解决方案,但我现在明白了,我没有写过它必须到位。请参阅更新的OP。