A dropped connection can leave a download partly saved. curl can continue the same partial file when the remote object is unchanged and the server accepts a range request.
curl resumes a download with --continue-at - or its short form -C -. The dash tells curl to read the current local file size and request only the remaining bytes from the server, appending them to the same output file instead of replacing it.
curl does not compare the bytes already saved with the remote file, so a finished file is only as good as the partial copy it grew from. A checksum published by the file's provider can confirm the finished contents.
Steps to resume an interrupted download with curl:
- Resume the transfer with --continue-at - and the same output filename used for the partial copy.
$ curl --continue-at - --output ops-agent-linux-amd64.tar.gz https://downloads.example.net/releases/ops-agent-linux-amd64.tar.gz ** Resuming transfer from byte position 262144 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed ##### snipped ##### 100 2.40M 100 2.40M 0 0 108.0M 0 0The URL must be the original one and the filename must match the partial copy in the current directory, because curl works out the resume position from that file. If the connection drops again, the same command continues from the new local size. A remote file that has changed since the partial copy was saved means a fresh download.
This error means the server ignored the range request, so the partial file cannot be continued from that server. A fresh download with the same output filename overwrites the partial copy.
curl: (33) HTTP server does not seem to support byte ranges. Cannot resume.
- Compare the finished file's SHA-256 digest with the one on the publisher's download page, when one is published.
$ sha256sum ops-agent-linux-amd64.tar.gz 0fbccecbe04b20c0ed1f4219523c2ce54bf59cb9b8128425ffe2371186bf6e8b ops-agent-linux-amd64.tar.gz
A matching digest confirms the resumed file is intact. A different digest means the contents do not match, even if the size looks right, so the file must not be used and a fresh download is required. Without a published digest, curl reaching 100% with no error shows only that the transfer finished. The check uses sha256sum on Linux.