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

时间:2010-06-04 17:56:38

标签: php ftp mirror

我想只镜像一些文件“Not directory”。我知道PHP ftp功能并使用它们,只是想知道我是否可以使服务器到服务器FXP工作。

我看到了CLI工具lftp,但它只反映了dir。 如果有其他工具可以访问文件。

3 个答案:

答案 0 :(得分:0)

您应该使用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 

答案 1 :(得分:0)

您可以连接到2台服务器并手动提供FXP命令 Wikipedia's - File eXchange Protocol

上有一个很好的例子

答案 2 :(得分:0)

不确定rsync的建议,因为rsync不支持通过FTP镜像,最后我检查了。

如果你想镜像文件,一个好方法是使用-mirror选项wget,或者检查ftpcopy。