大量小文件的网络传送

2009-05-06 xiao H Posted in 系统管理

A dir 目录下有N多小文件,要copy 到B 机去

a机
$ tar cf – dir | nc -l -p 1234

b机
$ nc 192.168.0.a 1234 | tar xf -

虽然linux 主机之间互传文件的方法很多,但这个方法的最大优点就是快。当然如果是海量数据还是直接按块读取比较靠谱。

标签:,

除特别声明外,本站作品皆为原创并以知识共享署名-相同方式共享 3.0 许可协议进行许可。
转载请注明 作者:xiao H,出处:linuxbyte.org ,原始链接:大量小文件的网络传送



  1. . 说:

    a机
    $ tar cf – dir | nc -l -p 1234 (这里不应该有“-p” 笔误吧)

    nc manpage:

    -p source_port
    Specifies the source port nc should use, subject to privilege restrictions and availability. It is an error to use this option
    in conjunction with the -l option.

我来说两句

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">