How to resume an ftp download at any point? (shell script, wget option)? How to resume an ftp download at any point? (shell script, wget option)? shell shell

How to resume an ftp download at any point? (shell script, wget option)?


Use wget with:

-c option

Extracted from man pages:

-c / --continue

Continue getting a partially-downloaded file. This is useful when you want to finish up a download started by a previous instance of Wget, or by another program. For instance:

               wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z

If there is a file named ls-lR.Z in the current directory, Wget will assume that it is the first portion of the remote file, and will ask the server to continue the retrieval from an offset equal to the length of the local file.


For those who'd like to use command-line curl, here goes:

curl -u user:passwd -C - -o <partial_downloaded_file> ftp://<ftp_path>

(leave out -u user:pass for anonymous access)


I'd recommend interfacing with libcurl from the language of your choice.