Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading a file with wget using multiple connections

How to download a file with wget using multiple connection in which each connection downloads a part of the file?

like image 614
user2789031 Avatar asked Mar 01 '14 12:03

user2789031


People also ask

How do I download multiple files using wget?

Wget Download Multiple Files From a File To download multiple files at once, use the -i option with the location of the file that contains the list of URLs to be downloaded. Each URL needs to be added on a separate line as shown. For example, the following file 'download-linux.

How do I download a file from a specific folder using wget?

Downloading a file to a specific directory When downloading a file, Wget stores it in the current directory by default. You can change that by using the -P option to specify the name of the directory where you want to save the file.

Is wget multi thread?

wget solution doesn't download one file in multiple threads: The options used -r is recursive, -np ( --no-parent ) — don't ascend to the parent directory, -N ( --timestamping ) — don't re-retrieve files unless newer than local. But wget would definitely work if you're downloading a mirror of a site.

How do I transfer files using wget?

Download file from destination server. From receiving server, navigate to the directory you'd like to download it to. Type wget https://domain.com/backup.tar.gz – to download external file to your current directory. (Of course, your file path and filename may vary.) Wait for it to finish transferring.


1 Answers

use aria2

 aria2c -x 16 [url] #where 16 is the number of connections 

OR

Just repeat the wget -r -np -N [url] for as many threads as you need. This isn’t pretty and there are surely better ways to do this, but if you want something quick and dirty it should do the trick.

Please look at http://blog.netflowdevelopments.com/2011/01/24/multi-threaded-downloading-with-wget/

like image 170
Jayesh Bhoi Avatar answered Sep 20 '22 13:09

Jayesh Bhoi