rsync:如果本地文件不存在,则复制文件。不要检查文件大小,时间,校验和等

时间:2013-09-09 13:59:18

标签: cygwin rsync

我正在使用rsync从我的linux服务器备份一百万张图像到我的电脑(使用Cygwin的Windows 7)。

我现在使用的命令是:

rsync -rt --quiet --rsh='ssh -p2200' root@X.X.X.X:/home/XXX/public_html/XXX /cygdrive/images

每当进程中断并重新启动时,启动复制过程需要很长时间。 我认为如果有任何更新,它会检查每个文件。

我的服务器上的图像一旦创建就不会改变。

那么,有没有更快的方法来运行命令,以便它可以复制文件,如果本地文件不存在而不检查文件大小,时间,校验和等...

请建议。

谢谢

1 个答案:

答案 0 :(得分:3)

你是否试过这个标志 - 这可能有所帮助,但可能还需要一些时间才能恢复转移:

       --ignore-existing
          This tells rsync to skip updating files that already exist on the destination  (this  does  not  ignore
          existing directories, or nothing would get done).  See also --existing.

          This  option  is  a  transfer  rule,  not  an exclude, so it doesn't affect the data that goes into the
          file-lists, and thus it doesn't affect deletions.  It just limits the files that the receiver  requests
          to be transferred.

          This  option  can be useful for those doing backups using the --link-dest option when they need to con-
          tinue a backup run that got interrupted.  Since a --link-dest run is copied into a new directory  hier-
          archy  (when  it  is used properly), using --ignore existing will ensure that the already-handled files
          don't get tweaked (which avoids a change in permissions on the hard-linked files).  This does mean that
          this option is only looking at the existing files in the destination hierarchy itself.