使用PHP将文件从一台服务器移动到另一台服务器的最佳方法是什么? [英] What is the best way to move files from one server to another with PHP?
问题描述
我想设置一个运行PHP脚本的CRON,该脚本又将XML文件(保存非敏感信息)从一台服务器移动到另一台服务器.
I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another.
已给我提供了正确的用户名/密码,并想使用SFTP协议.作业将每天运行.一台服务器可能是Linux,另一台服务器是Windows.两者都在不同的网络上.
I have been given the proper username/password, and want to use SFTP protocol. The jobs will run daily. There is the potential that one server is Linux and the other is Windows. Both are on different networks.
移动该文件的最佳方法是什么?
What is the best way to move that file?
推荐答案
If both servers would be on Linux you could use rsync for any kind of files (php, xml, html, binary, etc). Even if one of them will be Windows there are rsync ports to Windows.
这篇关于使用PHP将文件从一台服务器移动到另一台服务器的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!