LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Crond not reading/running /etc/crontab file [CentOS5] (http://www.linuxquestions.org/questions/linux-software-2/crond-not-reading-running-etc-crontab-file-%5Bcentos5%5D-671994/)

neocookie 09-24-2008 02:59 AM

Crond not reading/running /etc/crontab file [CentOS5]
 
Everything looks correct... file permissions, file locations, even `service crond status` says its running... but it doesn't read/execute the /etc/crontab file. Its a fresh install from yum (`yum install vixie-cron`), so I'm not sure what the problem would be.

Any ideas?

ChrisAbela 09-24-2008 03:15 AM

Cron normally communicates with the user via sendmail. If you are expecting cron to send you messages, maybe you might wish to check if sendmail is running.

Chris

neocookie 09-24-2008 03:25 AM

Nope. I'm doing very simple things with it; firstly I'm touching a file to see whether crond is reading the crontab file, secondly I'm echoing to another file.

Also, sendmail is running quite happily, as PHP is sending mail. Its simply that the crontab file isn't being read by crond.

ChrisAbela 09-24-2008 04:06 AM

What about /etc/cron.allow and /etc/cron.deny?
Are you sure about your syntax in /etc/crontab?
Did you use crontab -e to edit your /etc/crontab?

Chris

chrism01 09-24-2008 08:30 AM

Show us the entry in the crontab file.
Also check the local mail with mailx tool as your user and as root.

neocookie 09-24-2008 11:24 AM

There aren't any cron.allow/deny files, so (according to the docs) access should be unrestricted.

Inside the crontab file:
Code:


SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
20 5 * * * root run-parts /etc/cron.daily
13 5 * * 0 root run-parts /etc/cron.weekly
56 2 1 * * root run-parts /etc/cron.monthly

# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  command to be executed

10 17 * * * root run-parts touch /var/log/cron-test

So, nothing out of the ordinary. Whats really odd is that the set-up is no different than my redhat server, or the other CentOS boxes I have with the same provider.

I'm at a loss.

neocookie 09-24-2008 11:59 AM

Didn't use `crontab -e` to edit, but gave it a go. Seems to've sorted the problem. I come from a debian background; never seen management of cron elements using the crontab command.

Thanks guys!


All times are GMT -5. The time now is 04:51 AM.