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

前端 未结 3 715
温柔的废话
温柔的废话 2020-12-29 15:43

I want to download a huge file from an ftp server in chunks of 50-100MB each. At each point, I want to be able to set the \"starting\" point and the length of the chunk I wa

相关标签:
3条回答
  • 2020-12-29 16:22

    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)

    0 讨论(0)
  • 2020-12-29 16:23

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

    0 讨论(0)
  • 2020-12-29 16:35

    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.

    0 讨论(0)
提交回复
热议问题