Hacker News new | ask | show | jobs
by adrenalinup 4502 days ago
A very useful curl switch that I discovered, resume of partially downloaded file ! -C or --continue-at <offset>. When offset is "-", curl will use the output file to figure out the offset.

curl -C - -o "some_file"

It will basically get the size of "some_file" and use it as an offset when making the HTTP request, similar to wget --continue.

Very useful to download a file from a unreliable network and when you need all those security cookies. To get the cookies I use "Copy cURL" from Network pane of Chrome's "Developer tools".

1 comments

When I'm on a bad connection, I like to download the file on a server somewhere, then rsync it locally. As long as my server and the server I'm downloading from are on fast connections, the initial step doesn't take long, and this frees me from worrying about expiring cookies or URLs or whatever.
When downloading requires you to login, you absolutely need all the cookies even if you download it to your server first.

In this case, "Copy cURL" of a request from Chrome's Developer Tools is priceless.