cron is ignoring lines...
My current crontab looks like:
[root@sda03 ~]# crontab -l 0 0,8,16 * * * /opt/CMTSCheck/bin/GrabCMData.sh 37 * * * * /opt/CMTSCheck/bin/RegStateUpdate.sh 1 1 * * * /opt/CMTSCheck/bin/DropOldTables.sh For some reason, the only thing that will execute is the middle line... Any idea why? [root@sda03 ~]# grep GrabCMData /var/log/cron | wc -l 0 [root@sda03 ~]# grep DropOldTables /var/log/cron | wc -l 0 This is on a RH5.1 system with crontabs-1.10-8 installed. Am I doing something wrong? |
Are all of them executable? Check with ls -l.
|
Any message in the mail box of the crontab's owner?
|
Yes, they are all executable, and exist. There are no messages in the crontabs mailbox...
[root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/GrabCMData.sh -rwxr-xr-x 1 501 20 1.2K Apr 6 13:51 /opt/CMTSCheck/bin/GrabCMData.sh [root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/RegStateUpdate.sh -rwxr-xr-x 1 501 20 1.8K Mar 31 22:00 /opt/CMTSCheck/bin/RegStateUpdate.sh [root@sda03 ~]# ls -lah /opt/CMTSCheck/bin/DropOldTables.sh -rwxr-xr-x 1 root root 524 Mar 30 15:41 /opt/CMTSCheck/bin/DropOldTables.sh |
What about redirecting standard output and standard error to a file? Put the current date in the filename so that you know when the file has been created and if the cron job has run at the proper time:
Code:
0 0,8,16 * * * /opt/CMTSCheck/bin/GrabCMData.sh > /opt/$(date +\%Y\%m\%d\%H\%M)_GrabCMData.log 2>&1 |
All times are GMT -5. The time now is 07:33 PM. |