Multiple File Download Utility Using wget – mget

mget is a bash script to perform a multiple file download of files at URLs specified in a control file. The script is based around wget.

·

2 min read

mget allows unattended download of multiple files. The script is also ideal for use with cron, allowing, for example, overnight downloads.

The script is available as an AutoTools tarball or as a package for; Debian, Raspbian, Ubuntu, Fedora and openSUSE.

How mget works

This download utility consists of two components; a file containing the URLs of the files to download, and the script which processes the file and downloads the target files. The file containing the URLs can be named and located as you wish.

The easiest explanation is by example:-

If you want to use the same file and target directory each time, add the -p or –persist command line option to the above command and those locations will be stored for future use and a simple ‘mget’ command will perform the same command as above.

As mget processes each URL in the file that entry will be deleted if the download is successful.

Installing the mget package

The multiple file download package is called mget.
To prevent bitrot of this blog, please follow the installation instructions for your distribution at the project wiki:-
https://github.com/m-grant-prg/mget/wiki

An example cron setup

If you wanted to run the mget download overnight, every day except Friday at 00:10, you edit your crontab file by typing_:-_

crontab -e

and then entering the following line:-

10 00 * * 0,1,2,3,4,6 mget --quiet --sourcefile /home/your_user_name/Downloads/MultiGetSource.txt --targetdir /home/your_user_name/Downloads

Authoritative sources

The authoritative source for this project is held on GitHub at:-

The code repository:- https://github.com/m-grant-prg/mget

The wiki:- https://github.com/m-grant-prg/mget/wiki

To view or raise issues please visit:- https://github.com/m-grant-prg/mget/issues

My Projects