DIGIT-ARC read-only archive · snapshot: July 23, 2026

Free time scheduling in Ubuntu

28 posts · originally from https://geek.digit.in/community/threads/free-time-scheduling-in-ubuntu.81674/

C
cool_techie_tvm Original post #1
Mar 3, 2008 at 2:37 PM
Lets get the facts straight. Linux noob in here.

Ok, now here is my query. I schedule downloads during the free time (2am to 8am) on my windows installation. Here is how it works. By 2:10am i get connected (using rasdial). By 2:11am, utorrent starts downloading. By 7:55am the pc is shutdown.

I want to do the something similar in Ubuntu. I connect by issuing pon dsl-provider. I have also installed deluge torrent client.

Guide me fellas on how to schedule my downloads in Ubuntu :)

This schedule thingy is the only fact thats preventing me from being on ubuntu full time.
mediator
Mar 3, 2008 at 2:57 PM
May be a shell script?
abhinandh
Mar 3, 2008 at 2:59 PM
try gnome-sheduler in the repos.it uses cron
Rahim
Rahim #4
Mar 3, 2008 at 3:12 PM
^^ gnome-schedule
C
Mar 3, 2008 at 3:22 PM
Thanks guys. Ok i installed gnome-schedule. Now what? How do i set the connection to start at 2:10? How do i set deluge to start by 2:11am?? :(
Rahim
Rahim #6
Mar 3, 2008 at 3:40 PM
BTW i am getting this error
Code:
no crontab for rahim
while scheduling anything.
C
Mar 3, 2008 at 3:52 PM
The link mentioned, gives the procedure for installing gnome-schedule. I have already done that.
Rahim
Rahim #8
Mar 3, 2008 at 3:55 PM
^as you can see from my post, we both are in the same boat:D.
Hope someone guide both of us.
ray|raven
Mar 3, 2008 at 3:58 PM
Check if you have cron running in the list of processes.
Also check this link, *kevin.vanzonneveld.net/techblog/article/schedule_tasks_on_linux_using_crontab/

Regards,
ray
M
mehulved #10
Mar 3, 2008 at 4:07 PM
Found thisHOW TO: Gnome-Schedule
BTW i am getting this error
Code:
no crontab for rahim
while scheduling anything.
what does the command
Code:
crontab -l
return. Does it return the same?
Rahim
Rahim #11
Mar 3, 2008 at 4:11 PM
I get that error using gnome-schedule through The Terminal.
BTW here is what i get of crontab
Code:
user@HOST:~$ crontab 
crontab: usage error: file name must be specified for replace
usage:  crontab [-u user] file
        crontab [-u user] { -e | -l | -r }
                (default operation is replace, per 1003.2)
        -e      (edit user's crontab)
        -l      (list user's crontab)
        -r      (delete user's crontab)
M
mehulved #12
Mar 3, 2008 at 4:21 PM
So, your crontab is working. Just check gnome-schedule's settings, maybe since you seem to have compiled it. It's looking for crontab in the wrong place.
Rahim
Rahim #13
Mar 3, 2008 at 4:24 PM
^^ I installed it through the repo.
the Preferences option is greyed-out even when i start it with sudo.
ray|raven
ray|raven #14
Mar 3, 2008 at 4:25 PM
So, your crontab is working. Just check gnome-schedule's settings, maybe since you seem to have compiled it. It's looking for crontab in the wrong place.

AFAIK, Gnome-Schedule wont compile if it cant find crontab.
gary4gar
gary4gar #15
Mar 3, 2008 at 4:42 PM
its easy as pie, no need to install any extra packages, cron itself is very powerful.

my crontab looks like

Code:
# m h  dom mon dow   command
10 2 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet
10 2 * * * DISPLAY=:0.0 /opt/azureus/azureus
13 2 * * * wget -ci /home/gaurish/dl-list.txt
50 7 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet

Root's crontab
Code:
50 7 * * * /sbin/shutdown -h 0
ray|raven
ray|raven #16
Mar 3, 2008 at 4:46 PM
its easy as pie, no need to install any extra packages, cron itself is very powerful.

my crontab looks like

Code:
# m h  dom mon dow   command
10 2 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet
10 2 * * * DISPLAY=:0.0 /opt/azureus/azureus
13 2 * * * wget -ci /home/gaurish/dl-list.txt
50 7 * * * cd /home/gaurish/scripts && sh router-reboot.sh | telnet
Root's crontab
Code:
50 7 * * * /sbin/shutdown -h 0

Thats why i gave them that link :p

Btw, why use cd? just give the link to the script.
C
Mar 3, 2008 at 4:51 PM
I understand from gary4gar's post that he has created scripts to automate the whole procedure. Am curious of these scripts. How to create custom scripts in ubuntu? If i can create them, then its easy to schedule them using crontab.
M
mehulved #18
Mar 3, 2008 at 5:00 PM
scripts? You mean shell scripts?
C
Mar 3, 2008 at 5:05 PM
^^ well i guess so, told u am a noob as far as linux is concerned... :(
praka123
praka123 #20
Mar 3, 2008 at 5:09 PM
THIS post shows how!
*www.thinkdigit.com/forum/showpost.php?p=681714&postcount=97

I think u guys can browse tips and tricks in OSS Sticky thread ;)
C
Mar 3, 2008 at 6:10 PM
Wohoo !! I succeeded in automating the whole process..i tested it and its working fine... here is my crontab

Code:
10 2 * * * pon dsl-provider  # BSNL Connect, 
11 2 * * * DISPLAY=:0.0 /usr/bin/deluge # Deluge, 
55 7 * * * poff dsl-provider # BSNL Disconnect,

Thanks to everyone, especially to prakash for pointing me to the right thread..
praka123
praka123 #22
Mar 3, 2008 at 6:15 PM
^congrats ;)
Rahim
Rahim #23
Mar 3, 2008 at 6:45 PM
Thanks praka bhai tusi great ho!!!
It was so easy( after getting the guidance here).:D
abhi_10_20
Mar 21, 2008 at 12:36 PM
bump :neutral:

Could you help me out in doing all these with crontab:

1. hibernate(off)- 12:15 am
2. power on- 2 am
3. dsl on- 2 05 am
4. azureus on- 2 10 am
5. azureus close- 7 45 am
6. dsl off- 8 am
7. hibernate(off)- 8:05 am

can we automate all these?
abhinandh
abhinandh #25
Mar 21, 2008 at 4:30 PM
bump :neutral:
1. hibernate(off)- 12:15 am
2. power on- 2 am
those two need to be done from the BIOS.
search for scheduling featres in your BIOS if they exist.

3. dsl on- 2 05 am
4. azureus on- 2 10 am
5. azureus close- 7 45 am
6. dsl off- 8 am
7. hibernate(off)- 8:05 am
they can be configured from gnome-schedule(install it from repos)
or you can do it through CLI as mentioned above in this thread.
M
mehulved #26
Mar 21, 2008 at 6:32 PM
You maybe able to use *ubuntuforums.org/showthread.php?t=329902 for 1 and 7
for 3 to 6
Code:
crontab -e
It will open a file, it should look like this
5 2 * * * pon dsl-provider
10 2 * * * env DISPLAY=:0. azureus
45 7 * * * killall -HUP azureus
0 8 * * * poff dsl-provider
I am assuming you use pon, poff for connection and disconnection
I don't have azureus or ubuntu so I don't know the path to azureus, it would be a better idea to give the whole path.
And reading the appropriate man pages would have provided you all these answers
Or a search on your favourite search engine.
Only thing I have no idea about is how to automatically wake up from hibernate.

Also, see *ubuntuforums.org/showthread.php?t=313884 for query #2
abhi_10_20
Mar 21, 2008 at 7:24 PM
thanks.... from what i learnt, its impossible to auto power on using crontab...bcoz cron itself needs a manual system start to up and run. So....only thing left out is by the BIOS.... i explored there....but dint find any option like that... only had 'wake on lan' but my comp is not connected to any lan......any other ideas ? :(
Vivek788
Vivek788 #28
Apr 25, 2008 at 11:55 PM
hey i use crontab..and shutdown at 7.58 but as long as modem remains on..they take that much time as extra and divide total usage by time..i lost abt 800mb this month..help