Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > General Help
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

General Help
All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu.

 
Thread Tools Display Modes
Old March 29th, 2006   #1
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
cron jobs not running

I've followed the instructions at: https://wiki.ubuntu.com/CronHowto and I've even used Kcron to create a job and the successfully ran it manually through kcron, but the jobs don't run as scheduled.
When I open the system-monitor it has cron listed as a running service (cron not crond, if that matters)

Currently a crontab -l puts out:
# test
5 20 * * * /home/matt/Desktop/tbird.sh
# This file was written by KCron. Copyright (c) 1999, Gary Meyer
# Although KCron supports most crontab formats, use care when editing.
# Note: Lines beginning with "#\" indicates a disabled task.

tbird.sh is a script I run to start thunderbird for purposes of testing this, and it does work. Is there something that needs to be activated? (cron is checked off in my list of services)
chusome is offline   Reply With Quote
Old March 29th, 2006   #2
professor_chaos
Quad Shot of Ubuntu
 
professor_chaos's Avatar
 
Join Date: Apr 2005
Location: 127.0.0.1
Beans: 404
Ubuntu 9.04 Jaunty Jackalope
Re: cron jobs not running

I see your trying to run the script at hour 20 and minute 5, or 20:05.

Try and run the script via "/home/matt/Desktop/tbird.sh".
does it work?
__________________
Registered linux user 394273
professor_chaos is offline   Reply With Quote
Old March 29th, 2006   #3
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
Re: cron jobs not running

Yes, the script works
chusome is offline   Reply With Quote
Old March 30th, 2006   #4
dcstar
Ubuntu addict and loving it
 
Join Date: Feb 2005
Location: Melbourne, Australia
Beans: 7,158
Ubuntu 9.04 Jaunty Jackalope
Re: cron jobs not running

Quote:
Originally Posted by chusome
I've followed the instructions at: https://wiki.ubuntu.com/CronHowto and I've even used Kcron to create a job and the successfully ran it manually through kcron, but the jobs don't run as scheduled.
When I open the system-monitor it has cron listed as a running service (cron not crond, if that matters)

Currently a crontab -l puts out:
# test
5 20 * * * /home/matt/Desktop/tbird.sh
# This file was written by KCron. Copyright (c) 1999, Gary Meyer
# Although KCron supports most crontab formats, use care when editing.
# Note: Lines beginning with "#\" indicates a disabled task.

tbird.sh is a script I run to start thunderbird for purposes of testing this, and it does work. Is there something that needs to be activated? (cron is checked off in my list of services)
Running a script in a terminal environment does not mean that the script will run under cron.

You have to set up any various environment "assumptions" that are available in your terminal session that your script needs, for example does your script have something like this in the first line:
Code:
#!/bin/sh
__________________
Regards, David.

The Forum search function is useful for immediate help (give it a try).
Please mark your thread as "Solved" (using the Thread Tools) when appropriate.
dcstar is offline   Reply With Quote
Old March 30th, 2006   #5
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
Re: cron jobs not running

Here's the script contents:
#!/bin/bash
mozilla-thunderbird

As I stated earlier when I run the task manually through Kron it runs perfectly. As well this goes far beyond the script. Even the examples here: https://wiki.ubuntu.com/CronHowto do not run.
chusome is offline   Reply With Quote
Old March 30th, 2006   #6
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
Re: cron jobs not running

Also I don't care about the script, all I want to see is a working cronjob.
If anyone wants to post a sample test job, I'll try it.
chusome is offline   Reply With Quote
Old March 30th, 2006   #7
ubuntumaneh
A Carafe of Ubuntu
 
Join Date: Oct 2005
Beans: 148
Re: cron jobs not running

Have you tried this:
5 20 * * * /usr/bin/mozilla-thunderbird

Either use the complete path for mozilla-thunderbird in the script or just plug the above in the crontab. the script could be:
#!/bin/bash
/usr/bin/mozilla-thunderbird

EDIT: a more elegant way would be to set properly the variable PATH. So in crontab write:
PATH = /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:

Then we would be able to drop the paths in the script.

Last edited by ubuntumaneh; March 30th, 2006 at 09:25 AM..
ubuntumaneh is offline   Reply With Quote
Old March 30th, 2006   #8
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
Re: cron jobs not running

tried
17 17 * * * /usr/bin/mozilla-thunderbird

a few minutes ago and still no go, its like the daemon isn't actually running.
chusome is offline   Reply With Quote
Old March 30th, 2006   #9
ubuntumaneh
A Carafe of Ubuntu
 
Join Date: Oct 2005
Beans: 148
Re: cron jobs not running

Quote:
Originally Posted by chusome
a few minutes ago and still no go, its like the daemon isn't actually running.
This is not so precise, but try to restart the daemon then:
cd /etc/init.d
sudo ./cron restart
ubuntumaneh is offline   Reply With Quote
Old March 30th, 2006   #10
chusome
5 Cups of Ubuntu
 
Join Date: Oct 2005
Beans: 32
Angry Re: cron jobs not running

Ran those commands and got:
* Restarting periodic command scheduler... [ ok ]

So it appears to be running ok, so then I did:
crontab -e
and added
18 18 * * * /usr/bin/mozilla-thunderbird
then confirmed with
crontab -l

I set the job at precisely 18:16 and waited for 18:18 come. When the clock struck, still nothing happens. Afterwards I ran the job manually from kcron and it did run.

I'm starting to think this just wasn't meant to be.......
chusome is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:05 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry