門戶網(wǎng)站案例發(fā)稿推廣
curl斷點(diǎn)續(xù)傳
訪問外網(wǎng)資源,特別是Github上比較大的資源,例如,筆者遇到的calico
發(fā)布包,經(jīng)常會遇到在瀏覽器上下載半途中斷。
那么支持?jǐn)帱c(diǎn)續(xù)傳的下載工具,就是應(yīng)對這種情況的好幫手!
簡單的斷點(diǎn)續(xù)傳工具,就是shell
工具箱中的curl
!
它既支持?jǐn)帱c(diǎn)續(xù)傳,還支持嘗試次數(shù)的指定,那么嘗試次數(shù)就用喜歡的65535
,讓它昏天地暗吧!
腳本實(shí)例
curl -C - -LO --retry 65535 --retry-delay 60 [--retry-all-errors --retry-connrefused] https://github.com/projectcalico/calico/releases/download/v3.27.5/release-v3.27.5.tgz# 記得下載校驗(yàn)和文件進(jìn)行比對curl -C - -LO --retry 65535 --retry-delay 60 [--retry-all-errors --retry-connrefused] https://github.com/projectcalico/calico/releases/download/v3.27.5/SHA256SUMScat SHA256SUMSsha256sum release-v3.27.5.tgz
選項(xiàng)說明
選項(xiàng) | 說明 |
---|---|
-C - | 支持?jǐn)帱c(diǎn)續(xù)傳的選項(xiàng) |
–retry* | 支持嘗試次數(shù)、以及在什么情況下嘗試的選項(xiàng) |
- 某些低版本
curl
不支持[--retry-all-errors --retry-connrefused]
,可以用curl --help all
進(jìn)行查看是否支持選項(xiàng)
推薦工具
- 非常好用的腳本在線解釋器
- Git Bash SHell Using in Windows