I want to mirror only some files "Not directory". I know PHP ftp funct开发者_运维技巧ion and using them as well, just want to know if any way i can make server to server FXP working.
i saw CLI tool lftp but it mirrors dir only. And if there is some other tool that can fxp the files.
You could connect to the 2 servers and give the FXP commands manually.
There is an nice example on Wikipedia's - File eXchange Protocol page
You should be using rsync to do this.
Directly from their site:
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
Not sure about the recommendations for rsync, as rsync doesn't support mirroring over FTP, last I checked.
If you want to mirror files, a good approach would be wget using the -mirror option, or check out ftpcopy.
精彩评论