LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-05-2004, 04:09 PM   #1
robintw
Member
 
Registered: Jul 2004
Posts: 48

Rep: Reputation: 15
Cron - doesn't seem to run scheduled tasks


Hi all,

I am trying to use cron on a Suse 9.1 system and when I add an item to the /etc/crontab file it does not run. I have not needed to use cron until today and I have no idea how to sort this annoying problem.

My crontab line looks like this:

15 11 * * * root /home/robin/DDOWN/DDOWN,sh

I cannot see any problems with this line, but maybe somebody else can spot the (probably obvious) problem.

Thanks

Robin
 
Old 12-05-2004, 04:16 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Re: Cron - doesn't seem to run scheduled tasks

What happens when you run /home/robin/DDOWN/DDOWN,sh as root?

If I had to guess, I'd say "No such file or directory", referring to the comma where you probably meant dot. That looks like the type of typo I'm famous for is the only reason I sugest it.
 
Old 12-06-2004, 04:44 AM   #3
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Hi,

The comma rather than full stop was just a typo when I wrote my forum post. If I run /home/robin/DDOWN/DDOWN.sh as root it works fine.

Any other ideas?

Robin
 
Old 12-06-2004, 06:58 AM   #4
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
Is you computer switched on at 11:15 in the morning? Silly question perhaps, but I had a similar problem before.

Also are you sure that cron is actually running? Try running "ps -aux" in an xterm window, and see if crond is there. If not, you will need to make sure that it is starting when the system boots up.

Cron does not echo output to the screen, so check if there is any mail in root's inbox with any errors or output from cron.

I hope this helps
--Ian
 
Old 12-06-2004, 07:46 AM   #5
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Hehe ... I would have thought the computer needing to be on for cron to run would have been a given

Another thing -- If that script calls any other programs (and it almost certainly does) make sure you set PATH inside the script, or change the path in the crontab file to include all the search paths that you have in ${PATH} when you're logged in normally. Either that, or use full paths to any executables you have in your script.
 
Old 12-06-2004, 08:40 AM   #6
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks all.

The computer is definitly on all the time because it runs a webserver. I have checked that cron is running using ps -a | grep cron and cron IS running.

My program calls wget. At the top of the crontab is an entry saying path=/usr/bin (and lots of other paths I can't remember) but I will try the full path to wget (I think you use to command which to find the path to something that is already on the path).

I will also check roots mailbox, but I cannot check at the moment because I am at college and have not (yet) set up telnet access to my server!

Thanks

Robin
 
Old 12-06-2004, 08:50 AM   #7
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
Also check the cron log.
 
Old 12-06-2004, 09:34 AM   #8
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Quote:
Originally posted by robintw
I will also check roots mailbox, but I cannot check at the moment because I am at college and have not (yet) set up telnet access to my server!
Use SSH. Telnet is a server compromise waiting to happen.
 
Old 12-06-2004, 11:43 AM   #9
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
Yes. I should use SSH. I've just found out, however, that I cannot use telnet or SSH at college

There is nothing in the root (or any other user) mailbox about the cron job and the cron daemon is definitly running.

If I run /home/robin/DDOWN/DDOWN.sh from the commandline as root it works fine!

Where would I find the cron logs?

Robin
 
Old 12-06-2004, 03:29 PM   #10
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
The location is defined in /etc/syslog.conf, it's often /var/log/cron.
 
Old 12-06-2004, 03:32 PM   #11
robintw
Member
 
Registered: Jul 2004
Posts: 48

Original Poster
Rep: Reputation: 15
There is no entry for cron in syslog.conf and I /var/log/cron does not exist.

Any ideas what i should do?

Robin
 
Old 11-25-2005, 01:53 AM   #12
TongueTied
Member
 
Registered: Aug 2003
Distribution: SuSE 8.1 pro
Posts: 94

Rep: Reputation: 15
I'm finding a similar problem. Checking the running processes, I find that crond isn't running! I would have thought that it should have been running by default. Checking the runlevels, I find crond isn't there and I can't find a crond script anywhere. Considering how SuSE moves things and changes things, what have they done with crond? Have they replaced crontab with something else? If so, what?

I'm using SuSE 9.1 pro
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does cron do if machine is down when job is scheduled? Utah Linux - Software 4 08-24-2005 07:23 PM
scheduled tasks on a web server juanbobo Programming 3 05-16-2005 08:08 AM
Scheduled tasks? onionkn1ght Linux - Software 3 01-11-2005 10:20 PM
cron tasks MaverickApollo Linux - Software 1 02-02-2004 01:06 PM
Scheduled tasks... beserier Linux - General 1 01-24-2003 08:55 AM


All times are GMT -5. The time now is 08:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration