Wednesday, December 15, 2010

Automate downloads in Ubuntu

I live in India. And broadband service in India is mainly provided by BSNL. The connection (BBGFN 500) I have taken gives me 2 GB download/upload cap at normal hours and unlimited download from 2AM to 8AM. But the problem is to wake up at that time. So one should schedule downloads using various tools. And since I use Ubuntu 10.10 ,there is already a tool called crontab to schedule programs. For GUI use just install gnome-schedule from the Ubuntu Software Center.

First the network connection is
configured using the GUI of the network manager. Its a PPPoE dial thru etherenet for internet connection. After setting the connection using the Network manager goto to the terminal and type
nmcli con
This will display all the connections configured in Network manager. Just copy the UUID for the broadband connection.
Open up gnome-schedule. And create a task for running network connect command as given below
nmcli con up uuid "your connection UUID without quotes"
And create another task for running network disconnect command as given below
nmcli con down uuid "your connection UUID without quotes"
Also for shutdown of machine, you can load gnome-schedule with root privileges by running 
gksudo gnome-schedule
And create a shutdown task with the below command
init 0
Then of course you need to setup your torrent application. I am trying to find ways to schedule start all torrent files in transmission (the default app in ubuntu). Until now thats a failure. Also prioritization is a problem in transmission. And on top of that there are some issues with display going to sleep. The crontab entries don't work for when the display sleeps.

1 comment:

  1. Anonymous11:56 AM

    http://www.ubuntugeek.com/wake-on-plan-ui-for-managing-acpi-wakeups.html
    http://askubuntu.com/questions/61708/automatically-sleep-and-wake-up-at-specific-times

    ReplyDelete