Linux

通過網際網路將大文件從 Linux VPS 傳輸到 Windows 機器

  • August 18, 2011

我經常需要將幾 GB 大小的文件從 Linux VPS 傳輸到我的家用 Windows 機器。我正在嘗試找到適合我需要的傳輸方法。FTP/SFTP 可以工作,但與其他方法相比速度很慢,SCP 足夠快,但不支持簡歷,這對於這種大小的文件很重要,並且 rsync 沒有好的 Windows 客戶端,並且已經設置了作為備份解決​​方案,對於這種用途並不完全實用。有人對我可以使用什麼有任何建議嗎?目前我正在使用SFTP,但我無法承受速度,對我來說似乎幾乎是SCP的一半。

從(我的 OpenBSD 4.9 機器上的 rsync)的手冊頁中:

There  are  two  different  ways  for rsync to contact a remote system:
using a remote-shell program as the transport (such as ssh or  rsh)  or
contacting  an  rsync daemon directly via TCP. 

關鍵是我相信您可以使用 rsync 使用上面提到的第一個設置進行連接(遠端 shell 程序作為傳輸),並通過執行以下操作免費獲得斷開的連接恢復:

$ rsync -r -h -P -e "ssh -p 1234" user@host:/my/huge/file   anotherUser@anotherHost:/destination/

$$ Note on the switches: -r for recursive, -h for human-readable, -P for –partial (keep partially transferred files), and -e for specifying the remote shell to use. You can also use –partial-dir = DIR if you want to get fancy. $$ 在這種情況下,您不必在 windows 機器上執行 rsync 伺服器——只需一個 ssh 伺服器。有許多 ssh 伺服器可供選擇,您可以在 Windows 平台上使用(我建議使用putty,因為它具有獲勝者熟悉的 GUI 設置)。

我還將使用 md5 對您的文件進行雜湊處理並比較傳輸文件的 md5 以確保您的文件已正確傳輸,並且只需繼續觸發一個腳本,該腳本會從 linux 端保持 rsync 直到您正確傳輸的文件位於 win 上盒子。

引用自:https://serverfault.com/questions/302340