Simple download scheduling using AT and WGET in Linux

AT is a Linux command to execute command at a specific time. At allows fairly complex time specifications, extending the POSIX.2 standard. It accepts times of the form HH:MM to run a job at a specific time of day (AT Manual).

This little tips is useful if you want to download a big file and don't want to stay for a long time in front of your computer just to wait it complete.

To start wget Scheduling you need to put a wget command in a file. First find wget path using "which" command.

[root@linuxbox ~]# which wget
/usr/bin/wget
[root@linuxbox ~]#

Then write bellow line in a file and name it with wget-download.

#!/bin/bash
WGET=/usr/bin/wget
URL="http://domain.com/url-of-file.tar.gz"
OUT="/path/to/output/folder/url-of-file.tar.gz"

$WGET $URL -O $OUT




URL = URL of file
OUT = Path of your downloaded file

Now change your file permission using CHMOD command.

[root@linuxbox ~]#chmod u+x wget-download
Next type a single AT command.

[root@linuxbox ~]# at -m 18:00 < /path/of/wget-download


In above example, download will start at 18:00 and you should change this to suit your need. Now you can go to sleep and wait until it's complete.