LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Cron - doesn't seem to run scheduled tasks (https://www.linuxquestions.org/questions/linux-general-1/cron-doesnt-seem-to-run-scheduled-tasks-262949/)

robintw 12-05-2004 04:09 PM

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

sigsegv 12-05-2004 04:16 PM

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. :D

robintw 12-06-2004 04:44 AM

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

IBall 12-06-2004 06:58 AM

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

sigsegv 12-06-2004 07:46 AM

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.

robintw 12-06-2004 08:40 AM

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

LasseW 12-06-2004 08:50 AM

Also check the cron log.

sigsegv 12-06-2004 09:34 AM

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.

robintw 12-06-2004 11:43 AM

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

LasseW 12-06-2004 03:29 PM

The location is defined in /etc/syslog.conf, it's often /var/log/cron.

robintw 12-06-2004 03:32 PM

There is no entry for cron in syslog.conf and I /var/log/cron does not exist.

Any ideas what i should do?

Robin

TongueTied 11-25-2005 01:53 AM

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


All times are GMT -5. The time now is 02:10 AM.