代码之家  ›  专栏  ›  技术社区  ›  Arshdeep

如何在两个ftp之间镜像文件?

  •  1
  • Arshdeep  · 技术社区  · 14 年前

    我只想镜像一些“非目录”文件。我知道php ftp函数并使用它们,只是想知道是否有任何方法可以使服务器到服务器的fxp工作。

    我看到了cli工具lftp,但它只镜像dir。 如果有其他工具可以fxp文件。

    3 回复  |  直到 11 年前
        1
  •  0
  •   Bob Fanger    14 年前

    您可以连接到2个服务器并手动发出fxp命令。
    有一个很好的例子 Wikipedia's - File eXchange Protocol

        2
  •  0
  •   mmattax    14 年前

    你应该用 rsync 这样做。

    直接从他们的网站:

    rsync is a file transfer program for Unix systems. rsync uses the "rsync 
    algorithm" which provides a very fast method for bringing remote files into 
    sync. It does this by sending just the differences in the files across the 
    link, without requiring that both sets of files are present at one of the 
    ends of the link beforehand.
    
    Some features of rsync include
    
        * can update whole directory trees and filesystems
        * optionally preserves symbolic links, hard links, file ownership, 
          permissions, devices and times
        * requires no special privileges to install
        * internal pipelining reduces latency for multiple files
        * can use rsh, ssh or direct sockets as the transport
        * supports anonymous rsync which is ideal for mirroring 
    
        3
  •  0
  •   Anachronist    11 年前

    不确定rsync的建议,因为rsync不支持通过ftp镜像,我上次检查过。

    如果您想要镜像文件,一个好的方法是wget使用-mirror选项,或者签出ftpcopy。