Resuming curl Downloads Permalink: Resuming curl Downloads
I just needed to download another disk image from modern.ie to test a new site I'm working on in Internet Explorer. Most of these downloads are rather large files and can take some time to finish. Recently the internet connection hasn't been too great at the office as well as at home, plus I was moving around quite a bit, so there was never enough time to complete a download and I always ended up with incomplete files. I always restarted the download which overwrote the partially downloaded files – what a waste of time and energy. I took a look at the man pages for
curl and did a little bit of googling around to finally come up with a simple solution that let's you resume a partial download via
Since I never like when Terminal commands" options aren't explained (sometimes they might be a bit confusing), see the explanation below:
curl -C - -o partially-downladed-file 'http://path-to-original-file'
The options used are:
-C, --continue-at <offset> Continue/Resume a previous file transfer at the given offset. The given offset is the exact number of bytes that will be skipped, counting from the beginning of the source file before it is transferred to the destination. If used with uploads, the FTP server command SIZE will not be used by curl.
-C - Tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.
-o Write output to
You can see all possible options for
curl by typing
man curl in Terminal.