Answers:
这可能就是您想要的。
% rsync -avvz --times --stats --checksum --human-readable --acls \
--itemize-changes --progress \
--out-format='[%t] [%i] (Last Modified: %M) (bytes: %-10l) %-100n' \
/usr/include/glib-2.0 my-glib-copy/
开关分解如下:
注:请参阅手册页rsync
和rsyncd.conf
为上述开关全部细节。
上面的命令产生以下记录:
sending incremental file list
delta-transmission disabled for local transfer or --whole-file
[2012/12/23 21:34:46] [cd+++++++++] (Last Modified: 2010/12/19-08:13:31) (bytes: 4096 ) glib-2.0/
[2012/12/23 21:34:46] [>f+++++++++] (Last Modified: 2010/09/30-15:02:30) (bytes: 1511 ) glib-2.0/glib-object.h
1.51K 100% 0.00kB/s 0:00:00
1.51K 100% 0.00kB/s 0:00:00 (xfer#1, to-check=181/183)
[2012/12/23 21:34:46] [>f+++++++++] (Last Modified: 2010/09/30-15:02:30) (bytes: 2910 ) glib-2.0/glib.h
2.91K 100% 2.78MB/s 0:00:00
2.91K 100% 2.78MB/s 0:00:00 (xfer#2, to-check=180/183)
[2012/12/23 21:34:46] [>f+++++++++] (Last Modified: 2010/09/30-15:02:31) (bytes: 3613 ) glib-2.0/gmodule.h
3.61K 100% 3.45MB/s 0:00:00
3.61K 100% 3.45MB/s 0:00:00 (xfer#3, to-check=179/183)
...
...
[2012/12/23 21:34:46] [>f+++++++++] (Last Modified: 2010/09/30-15:02:31) (bytes: 8431 ) glib-2.0/gobject/gvaluecollector.h
8.43K 100% 141.96kB/s 0:00:00
8.43K 100% 141.96kB/s 0:00:00 (xfer#178, to-check=1/183)
[2012/12/23 21:34:46] [>f+++++++++] (Last Modified: 2010/09/30-15:02:31) (bytes: 8507 ) glib-2.0/gobject/gvaluetypes.h
8.51K 100% 143.23kB/s 0:00:00
8.51K 100% 143.23kB/s 0:00:00 (xfer#179, to-check=0/183)
total: matches=0 hash_hits=0 false_alarms=0 data=1305506
rsync[2996] (sender) heap statistics:
arena: 540672 (bytes from sbrk)
ordblks: 3 (chunks not in use)
smblks: 7
hblks: 2 (chunks from mmap)
hblkhd: 401408 (bytes from mmap)
allmem: 942080 (bytes from sbrk + mmap)
usmblks: 0
fsmblks: 592
uordblks: 404784 (bytes used)
fordblks: 135888 (bytes free)
keepcost: 134240 (bytes in releasable chunk)
rsync[2999] (server receiver) heap statistics:
arena: 286720 (bytes from sbrk)
ordblks: 2 (chunks not in use)
smblks: 8
hblks: 3 (chunks from mmap)
hblkhd: 667648 (bytes from mmap)
allmem: 954368 (bytes from sbrk + mmap)
usmblks: 0
fsmblks: 672
uordblks: 174480 (bytes used)
fordblks: 112240 (bytes free)
keepcost: 102352 (bytes in releasable chunk)
rsync[2998] (server generator) heap statistics:
arena: 233472 (bytes from sbrk)
ordblks: 4 (chunks not in use)
smblks: 6
hblks: 2 (chunks from mmap)
hblkhd: 401408 (bytes from mmap)
allmem: 634880 (bytes from sbrk + mmap)
usmblks: 0
fsmblks: 448
uordblks: 83152 (bytes used)
fordblks: 150320 (bytes free)
keepcost: 131120 (bytes in releasable chunk)
Number of files: 183
Number of files transferred: 179
Total file size: 1.31M bytes
Total transferred file size: 1.31M bytes
Literal data: 1.31M bytes
Matched data: 0 bytes
File list size: 6.30K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 350.39K
Total bytes received: 3.43K
sent 350.39K bytes received 3.43K bytes 707.64K bytes/sec
total size is 1.31M speedup is 3.69
我遇到了这个SF问题:
答案之一提到,在较新的版本中rsync
,现在支持进度条。看起来像这样:
% ./rsync -a --info=progress2 /usr .
305,002,533 80% 65.69MB/s 0:00:01 xfr#1653, ir-chk=1593/3594)
该进度条仍未显示传输中单个文件的状态,但确实显示了整个传输的百分比,这可能会有所帮助。
您是否在守护程序模式下使用rsync?rsync(在Debian 6上)的默认行为是您的请求方式。但是,我在rsyncd.conf的手册页中发现,守护程序模式下的默认行为是:
传输日志记录
此参数启用按文件记录下载和上传的文件,格式类似于ftp守护程序使用的格式。守护程序始终在最后记录传输,因此,如果传输中止,则在日志文件中不会提及任何内容。
如果要自定义日志行,请参见“日志格式”参数。
因此,如果在守护程序模式下使用rsync,则似乎必须在rsyncd.conf中添加“传输日志”行。
我认为您需要的是Pipe Viewer:https://code.google.com/p/pipeviewer/