How To resume downloads with wget, curl, and aria2

download
tips-and-tricks
Tags: #<Tag:0x00007fbb516d86c0> #<Tag:0x00007fbb516d8530>
(Ben Bullard) #1

Hello,

  • OpenMandriva Lx version:
    ALL

  • Desktop environment (KDE, LXQT…):
    ALL

  • Description of the issue (screenshots if relevant):
    Downloads get interrupted sometimes. Especially frustrating for larger downloads like ISO files.

  • Relevant informations (hardware involved, software version, logs or output…):

Here’s Link: Resuming Download In Wget, cURL & aria2c - Subin's Blog

:hear_no_evil: :see_no_evil: :speak_no_evil:

0 Likes

(Ben Bullard) #2

Synopsis and this is quoted from that link.

Normally you would not download as root.

$ curl -L -C - -o "myfile.zip" "http://example.com/file.zip

Here is what the options mean :

## Option ## What It Does
-L Some URLs redirect to some other sites. This option tells cURL to obtain the file from that redirected location.
-C – This option is for telling cURL to resume download and the dash ("-") that follows it is to automatically detect the size of the file to continue downloading.
-o “myfile.zip” This parameter says the output location of the file being downloaded.

The last quoted value is the URL of the file. This command can be used to download for the first time as well as resuming it later.

:monkey:

1 Like

(Ben Bullard) #3

Synopsis and this is quoted from that link.

Normally you would not download as root.

$ aria2c -c -m 0 -o "myfile.zip" "http://example.com/file.zip"

Here is the explanation of each options used in the above command :

## Option ## What It Does
-c Tells aria2c to resume downloads
-m 0 This option will make aria2c retry downloads for unlimited times. Some servers tend to break connection after some time. But, this option makes aria2c to auto retry when such things happen.
-o “myfile.zip” This parameter says the output location of the file being downloaded.

Like before, the last quoted value is the URL of the file.

:monkey_face:

1 Like

(Ben Bullard) #4

Synopsis and this is quoted from that link.

Normally you would not download as root.

$ wget -d -c --tries=0 --read-timeout=30 -O "myfile.zip" "http://example.com/file.zip"

And here is the explanation of the options used :

## Option ## What It Does
-d Tells wGet to Download the File
-c Tells wGet to resume download
–tries=0 Tells wGet to retry connections unlimitedly when it is interrupted.
–read-timeout=30 If no response is received in 30 seconds, exit and establish a new connection
-O “myfile.zip” Sets the output location of the downloaded file.

Have fun downloading

:monkey:

2 Likes

(Ben Bullard) closed #5
0 Likes

(Ben Bullard) opened #6
0 Likes

(Ben Bullard) #7

To simplify for aria2. If I cd to the directory where I want to download an ISO file this will work just fine.

$ aria2c -c -m 0 <file_to_download.iso>

I suspect these would work as well:

$ wget -d -c --tries=0 --read-timeout=30 <file_to_download.iso>

$ curl -L -C - <file_to_download.iso>

But I have not tested the wget and curl commands yet.

0 Likes