0
我想寫一個PHP腳本,將一個特定的文件從一個Web服務器(Linux)複製到另一個(Linux)。同步一個文件從一個Web服務器到另一個
我想寫一個PHP腳本,將一個特定的文件從一個Web服務器(Linux)複製到另一個(Linux)。同步一個文件從一個Web服務器到另一個
你可以像這樣在PHP中執行rsync。
exec('rsync -ruva --progress /local/file.png [email protected]:/tmp/file.png');
檢查here的信息,如何設置密碼的ssh rsync的運行。
在PHP中可以使用的fopen和與fgets(見http://php.net/manual/de/features.remote-files.php)