redhat 5.2 tikanga crond running but not reading crontab file

Issue:crond is running, can even restart it and /var/log/cron shows it starting. The /etc/crontab file is correct as compared to another machine. I set the crontab file to enter a datestamp into a file under /tmp every minute. Thing is, the crontab file is not being read or cron is not working correctly. I have deleted the crontab entries and retried entering them in again, still not working. No errors either in /var/log/messages.

Anyone know what I can do to get cron working as it should again?

---------- Post updated at 02:01 PM ---------- Previous update was at 01:33 PM ----------

correction, when crond is restarted it does read /etc/crontab, yet it never runs anything in that file.

Post the entry of your crontab and your script.

00 01 * * * /opt/CancelAuthCronJOB/cancelauth.sh >> opt/CancelAuthCronJOB/logs/CancelAuth.log
00 01 * * * /opt/DailySettlementJob/DailySettlement.sh >> /opt/DailySettlementJob/logs/dailysettlement.log
00 01 * * * /opt/MonthlySettlementJob/MonthlySettlement.sh >> /opt/MonthlySettlementJob/logs/monthlysettlement.log
0 * * * *  /home/smeka1/shellscripts/monitoradapterlogs.sh erros_log.txt
30 * * * * /usr/bin/logSetfaclScript.sh >> /tmp/logsetfacl.log

what is the output?

 
# tail -f /var/log/cron | grep CMD

there is none. should i stop/start it and tail the log?

---------- Post updated at 02:28 PM ---------- Previous update was at 02:27 PM ----------

i'm just gonna post the last 40 or so lines from that log:

Jul 22 12:04:05 bmasnq02 crontab[10599]: (root) LIST (root)
Jul 22 12:05:01 bmasnq02 crond[27141]: (*system*) RELOAD (/etc/crontab)
Jul 22 12:05:01 bmasnq02 crond[27141]: nss_ldap: reconnected to LDAP server ldap://sdssnq02/ after 1 attempt
Jul 22 12:07:06 bmasnq02 anacron[32759]: Job `cron.weekly' started
Jul 22 12:08:18 bmasnq02 anacron[32759]: Job `cron.weekly' terminated
Jul 22 12:08:18 bmasnq02 anacron[32759]: Normal exit (2 jobs run)
Jul 22 12:12:30 bmasnq02 crontab[21242]: (root) BEGIN EDIT (root)
Jul 22 12:13:28 bmasnq02 crontab[21242]: (root) END EDIT (root)
Jul 22 12:14:13 bmasnq02 crontab[22869]: (root) BEGIN EDIT (root)
Jul 22 12:14:28 bmasnq02 crontab[22869]: (root) END EDIT (root)
Jul 22 12:14:49 bmasnq02 crond[23432]: (CRON) STARTUP (V5.0)
Jul 22 12:15:49 bmasnq02 crontab[24522]: (root) BEGIN EDIT (root)
Jul 22 12:15:58 bmasnq02 crontab[24522]: (root) REPLACE (root)
Jul 22 12:15:58 bmasnq02 crontab[24522]: (root) END EDIT (root)
Jul 22 12:16:01 bmasnq02 crond[23432]: (root) RELOAD (cron/root)
Jul 22 12:16:19 bmasnq02 crontab[25143]: (root) BEGIN EDIT (root)
Jul 22 12:16:43 bmasnq02 crontab[25143]: (root) REPLACE (root)
Jul 22 12:16:43 bmasnq02 crontab[25143]: (root) END EDIT (root)
Jul 22 12:17:01 bmasnq02 crond[23432]: (root) RELOAD (cron/root)
Jul 22 12:17:19 bmasnq02 crontab[26292]: (root) BEGIN EDIT (root)
Jul 22 12:17:31 bmasnq02 crontab[26292]: (root) REPLACE (root)
Jul 22 12:17:31 bmasnq02 crontab[26292]: (root) END EDIT (root)
Jul 22 12:17:38 bmasnq02 crontab[26834]: (root) BEGIN EDIT (root)
Jul 22 12:18:01 bmasnq02 crond[23432]: (root) RELOAD (cron/root)
Jul 22 12:19:05 bmasnq02 crontab[28460]: (root) LIST (root)
Jul 22 12:19:14 bmasnq02 crontab[28461]: (root) BEGIN EDIT (root)
Jul 22 12:19:21 bmasnq02 crontab[26834]: (root) END EDIT (root)
Jul 22 12:19:24 bmasnq02 crontab[28461]: (root) REPLACE (root)
Jul 22 12:19:24 bmasnq02 crontab[28461]: (root) END EDIT (root)
Jul 22 12:19:28 bmasnq02 crontab[28466]: (root) BEGIN EDIT (root)
Jul 22 12:19:30 bmasnq02 crond[28520]: (CRON) STARTUP (V5.0)
Jul 22 12:20:00 bmasnq02 crontab[28466]: (root) REPLACE (root)
Jul 22 12:20:00 bmasnq02 crontab[28466]: (root) END EDIT (root)
Jul 22 12:20:01 bmasnq02 crond[28520]: (root) RELOAD (cron/root)
Jul 22 12:20:33 bmasnq02 crontab[29617]: (root) BEGIN EDIT (root)
Jul 22 12:20:37 bmasnq02 crontab[29617]: (root) END EDIT (root)
Jul 22 12:23:57 bmasnq02 crontab[969]: (root) LIST (root)

how do add the entries in crontab file ?

crontab -e

or

vim /var/spool/cron/root

crontab -e, but if i cat the /var/spool/cron/root i see the same thing in there. I actually noticed a couple of entries missing either the full directory or a preaviling "/". here is the output of both now:

crontab -l:
00 01 * * * /opt/CancelAuthCronJOB/cancelauth.sh >> /opt/CancelAuthCronJOB/logs/CancelAuth.log
00 01 * * * /opt/DailySettlementJob/DailySettlement.sh >> /opt/DailySettlementJob/logs/dailysettlement.log
00 01 * * * /opt/MonthlySettlementJob/MonthlySettlement.sh >> /opt/MonthlySettlementJob/logs/monthlysettlement.log
0 * * * *  /home/smeka1/shellscripts/monitoradapterlogs.sh >> /home/smeka1/shellscripts/erros_log.txt
20,21,30 * * * * /usr/bin/logSetfaclScript.sh >> /tmp/logsetfacl.log

cat /var/spool/cron/root:

00 01 * * * /opt/CancelAuthCronJOB/cancelauth.sh >> /opt/CancelAuthCronJOB/logs/CancelAuth.log
00 01 * * * /opt/DailySettlementJob/DailySettlement.sh >> /opt/DailySettlementJob/logs/dailysettlement.log
00 01 * * * /opt/MonthlySettlementJob/MonthlySettlement.sh >> /opt/MonthlySettlementJob/logs/monthlysettlement.log
0 * * * *  /home/smeka1/shellscripts/monitoradapterlogs.sh >> /home/smeka1/shellscripts/erros_log.txt
20,21,30 * * * * /usr/bin/logSetfaclScript.sh >> /tmp/logsetfacl.log

hmm ok..

pls can u write the output

 
# ls -l /opt/CancelAuthCronJOB/cancelauth.sh 
# ps -ef | grep cron
[root@bmasnq02 tmp]# ls -l /opt/CancelAuthCronJOB/cancelauth.sh
-rwxrwxrwx 1 root root 4797 Oct  1  2009 /opt/CancelAuthCronJOB/cancelauth.sh


[root@bmasnq02 tmp]# ps -ef | grep cron
root      1559     1  0 12:54 ?        00:00:00 crond
root      4253  4798  0 13:26 pts/0    00:00:00 grep cron
[root@bmasnq02 tmp]#

---------- Post updated at 04:27 PM ---------- Previous update was at 03:26 PM ----------

[/COLOR]I have verified if I run the hourly/daily/weekly cron jobs that they work. I also removed everything from the crontab and just put in this line:

* * * * * echo Date `date` >> /tmp/crontest

but it won't even run that.

Check your mail and is there any error about cron?

The format of /etc/crontab and the files in /etc/cron.d are different from user crontabs. You appear to be using user crontab syntax which is incorrect.

Ok, then how should they look? I have verified on another system that is identical that the files all look the same, have same size, have same perms....

---------- Post updated at 05:38 PM ---------- Previous update was at 05:37 PM ----------

Nope, no errors. That's what is puzzling me.

Typically /etc/crontab looks like:

The system crontab file looks almost identical to a user's crontab file, with a couple of subtle differences.

  • The system crontab file is not stored in /var/spool/cron, and is not managed with the crontab command. Instead, the file is edited directly with a text editor.

  • Entries contain an additional sixth field, which occurs after the five time specification fields but before the command. This field specifies the user the following command should run as (which is usually root).

The default /etc/crontab file comes with only four entries, each of which runs the command run-parts on one of the /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, or /etc/cron.monthly directories. Sysadmins are free to add their own entries to the /etc/crontab file.