Help to schedule a job using cron

Asked by Mathew Roy

hi all.
thanx in advance..
I want to execute the program "Transmission" at 2:00am. I tried using cron but it does not seem to working.
this is what I did.
crontab -e
# 00 2 * * * transmission

then saved it...
but nothng happend at the time...
is there anything wrong in what I have done?
I am a ubundu newbe. So plz help...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cron Edit question
Assignee:
No assignee Edit question
Solved by:
Jeruvy
Solved:
Last query:
Last reply:
Revision history for this message
Brewster Malevich (brews) said :
#1

Run crontab -e with sudo and loose the hash/pound before the "cron" command.
Ooo, also, if you shut off your machine alot, you might want to consider "anacron" instead of "cron".

Community docs has a handy how-to:
https://help.ubuntu.com/community/CronHowto

Hope this helps! :-)

Revision history for this message
Mathew Roy (mathewroy007) said :
#2

yes I did as Brews said. But sadly it does no work for me.
The cpu usage momentarely goes up but nothing happens. By the way, in which file/ path I should be saving the crontab?

Revision history for this message
Jeruvy (jeruvy) said :
#3

crontab - e <details> will add(edit) a crontab with your permissions

sudo crontab -e .... will add(edit) a crontab with root permissions.

If the first character in the crontab entry is a # then it's a comment and nothing is performed.

[sudo] crontab -l will list your entries to confirm they are setup properly.

HTH.

Revision history for this message
Sam_ (and-sam) said :
#4

GUI option would be gnome-schedule [universe].
add:
http://www.linuxtoday.com/infrastructure/2009040900535OSHLSW

Revision history for this message
Mathew Roy (mathewroy007) said :
#5

thanz 4 help all of u.
I dont knw y this is not working for me....
Well plz post the exat command to start Transmission (the torrent downloader) at 02:00 everyday.

Revision history for this message
Mathew Roy (mathewroy007) said :
#6

plz post the exat command to start Transmission (the torrent downloader) at 02:00 everyday.
Plz also suggest any alternatives..

Revision history for this message
Best Jeruvy (jeruvy) said :
#7

Ok, here ya go.

$ crontab -e

[Opens user crontab file in Nano, use down arrow to move to the first blank line and add]

0 2 * * * Transmission

[Press Control and O to SAVE, and then Control and X to EXIT Nano]

Done.

Now since Transmission is a GUI based tool, it's possible you could run multiple instances of this when you probably don't want to, so it may be better to execute a bash script that first checks if Transmission is running and IF NOT, then start it up. But try this first to see if it works for you.

Good luck,

Revision history for this message
Mathew Roy (mathewroy007) said :
#8

Thanks Jeruvy, that solved my question.