2011-05-18 117 views

回答

0

此功能不內置,我知道的任何客戶端,或爲此事甚至FTP協議。

一個模仿此功能的客戶端是Cyberduck,它具有「同步」功能,允許您使用時間戳上傳到FTP服務器的同步文件夾的任何更改。

1

下面是我通過docs會後想出了一個教程:

  1. 下載並安裝WinSCP並運行它
  2. 連接到服務器
  3. 轉到菜單>會話>服務器/協議信息
  4. 複製 「Server host key指紋」(ssh-rsa 2048 xx:xx:xx:xx..."

現在創建一個名爲upload.txt文件,添加以下內容(根據需要修改):

# Connect 
open sftp://user:[email protected]/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..." 
# Change remote directory 
cd /home/user/public 
# Download file to the local directory d: 
get robots.txt d:\ 
# Upload file to current working directory 
put d:\examplefile.txt 
# Disconnect 
close 
# Exit WinSCP 
exit 

接下來創建一個批處理文件run.bat用正確的路徑:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /script="C:\folder-with-uploadfile\upload.txt" 
pause 

運行該批處理文件。

檢查檢查文件robots.txt是否已下載到文件夾D:並且examplefile.txt位於服務器上的示例文件夾中。

在多臺服務器的情況下:https://winscp.net/eng/docs/script_upload_multiple_servers


PS:我的FileZilla的長期用戶,但2018年2月,他們沒有這個功能呢。所以爲WinSCP +1。

+1

+1雖然您最好使用'winscp.com'而不是'winscp.exe',以便您可以在控制檯窗口中看到進度(和錯誤)。 – 2018-02-15 07:45:36

+1

偉大的提示。發佈更新。並且:您創建的令人敬畏的軟件。腳本將節省數小時的時間。 – 2018-02-15 07:53:30

相關問題