Time your off-peak download with at Linux command

Not everyone has unlimited Internet download. Sometimes Internet provides provide peak and off-peak hours and hardly is someone going to stay up at night to trigger their downloads.

There are many tools in Linux which allows user to set a timer to automatically start download without user intervention. Here is a simplest form of automatic off-peak download involving at, wget and shutdown command. First create a file which will contain wget and shutdown commands:

mydownloads.txt:

wget ftp://ftp.redhat.com/pub/redhat/rhel/beta/6/i386/iso/RHEL6.0-20100414.0-AP-i386-DVD1.iso
wget http://ftp.monash.edu.au/pub/linux/CentOS/5.5/isos/i386/CentOS-5.5-i386-bin-DVD.iso
shutdown -h now

Now use at command to execute all command within mydownloads.txt file:

at -m 02:00 < mydownloads.txt

At command will automatically start download at 2AM and when downloads are finished it will shutdown your PC.

NOTE: For shutdown you need sudo or run command as root