UP | HOME

rsync

Table of Contents

大文件续传

使用 -P 参数:

-P     The -P option is equivalent to --partial --progress.
       Its  purpose  is to make it much easier to specify these
       two options for a long transfer that may be interrupted.

其中 --progress 参数的作用:

--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.

默认情况下,rsync在传输中断的情况下会删除部分传输的文件,使用–partial参数后,传输中断时会保留这些文件,当传输重启时会接着已传的部分继续传输,即断点续传。 例如:

rsync -avP ./SRC_DIR/file1 ./DES_DIR/

与之相关的参数:

  • –append
--append
This causes rsync to update a file by appending data onto
the end of the file, which presumes that the data that
already exists on the receiving side is identical with
the start of the file on the sending side.

–append参数使文件续传时直接开始传输已有部分后面的部分,和–partial的区别待研究。

  • –inplace
--inplace
This option changes how rsync transfers a file when its
data needs to be updated: instead of the default method
of creating a new copy of the file and moving it into
place when it is com- plete, rsync instead writes the
updated data directly to the destination file.

更新数据时,rsync默认会在其他路径下生成新的文件,传输完成后替换目标文件;使用–inplace后,直接将更新的数据写到目标文件。

Date: 2014-11-06 Sun

Author: manan

Created: 2014-11-07 Fri 11:29

Emacs 23.1.1 (Org mode 8.2.1)

Validate