我想只镜像一些文件“Not directory”。我知道PHP ftp功能并使用它们,只是想知道我是否可以使服务器到服务器FXP工作。
我看到了CLI工具lftp,但它只反映了dir。 如果有其他工具可以访问文件。
答案 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。