我正在使用
Linux中的卷曲.我正在ftp服务器下载文件的一部分(使用-r选项),但我的连接不好,它总是中断.我想编写一个脚本,当我再次连接时,它会恢复下载.
我已经使用这个命令,但它不工作:
- until curl -r 666-9999 -C - --retry 999 -o "path/to/file" "ftp:/path/to/remote/file"; do :; done
解决方法
wget是为这个用例专门构建的.从手册页:
- Wget has been designed for robustness over slow or unstable network connections;
- if a download fails due to a network problem,it will keep retrying until the
- whole file has been retrieved. If the server supports regetting,it will
- instruct the server to continue the download from where it left off.
wget几乎可以用于所有的Linux发行版 – 它可能已经安装在你的.只需使用wget下载文件,就会重新建立网络连接,直到文件完全传输.