BSNL is the culprit of spreading insomnia(sleeplessness) among young India. In other words, the happy hours of BSNL free download is scheduled from 0200 hrs to 0800 hrs which results in people staying awake early in the morning and missing out on the essential sleep. This is when automation tools and schedulers come to picture.
This guide basically does you want to do at 0200 hrs and 0800 hrs with a BSNL broadband connection. This works only if your modem is configured in the bridge mode and not in the PPPoE mode, assuming most of you have port-forwarding enabled for higher download speeds which by default needs bridge mode.
OK, here we go. At 0200 hrs -
- You want to start the internet connection
- You want to reset your IP
- You want to start your torrent client
and at 0800 hrs -
- You want to stop the internet connection
- You want to stop your torrent client
At a point when you are about to sleep, turn off the internet connection with this command in the terminal:
sudo /etc/init.d/networking stop
Now, start your torrent client and enable all downloads. The downloads will not begin since your internet is off. Remember your modem is still ON.
The main task here is to switch on the internet connection at 0200 hrs, and stop the connection at 0800 hrs and close all torrent clients and download managers. For this we use the inbuilt automation tool in Linux, cron. Open up the terminal and -
sudo crontab -e
Note that if you are running cron for the first time, it asks you to choose an editor. I strongly recommend you to use nano. Enter the following lines into the file -
05 02 * * * /etc/init.d/networking restart
55 07 * * * killall ktorrent deluge
55 07 * * * /etc/init.d/networking stop
Save and close the file. Here replace ktorrent or deluge with your favorite torrent client. Once this is done, your internet automatically restarts at 5 past 2 early morning, starts all your downloads and turns down the internet at 5 minutes to 8 and also closes down the torrent clients.
Now, you may ask how do I initially configure my internet connection in Bridge mode. Thats simple as well.
Open the terminal -
Follow on screen instructions, enter your BSNL username and password when asked and done, your connection is up and running and activates at every boot.
With this, you can now sleep tight. Good night.
PS: To automate stuff in the PPPoE mode, follow Madhusudan’s Guide.