Linux如何實現斷點續傳文件功能?

  面對網絡狀況不好的情況,在Linux系統上傳輸文件或者下載文件,很容易發生中斷,反反覆覆的操作讓人十分頭大,因此大家想要每次傳輸或下載部分文件,也就是所謂的斷點續傳。那麼Linux如何實現斷點續傳文件功能呢?具體代碼如下:

  文件斷點下載

  rsync -P --rsh=ssh [email protected]:/root/m.tar.gz /test /n.tar.gz

  文件斷點上傳

  rsync -P --rsh=ssh /test/n.tar.gz [email protected]:/root/m.tar.gz

  文件目錄斷點下載

  rsync -P --rsh=ssh -r [email protected]:/root/stor /test

  文件目錄斷點上傳

  rsync -P --rsh=ssh -r /test [email protected]:/root/stor

  後臺運行,將以上腳本放入shell文件中

  cat bg.sh

  rsync -P --rsh=ssh -r [email protected]:/root/stor /test &

  後臺運行

  chmod +x bg.sh

  nohup ./bg.sh

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章