Link to home
Start Free TrialLog in
Avatar of BostonDynamics
BostonDynamicsFlag for United States of America

asked on

Why have my weekly cron jobs begun running bi-weekly?

Here is a line from our /etc/crontab (enterprise Linux 4)

02 09 * * 1 root /admin/licenses/bin/demo.sh

For the last four weeks, the script has only run every other week.  No significant changes have been made to the server.  Running the script as root succeeds at all times.  

Avatar of agriesser
agriesser
Flag of Austria image

crontab looks sane. Can you add the following line to this command to log execution?

Have you checked your local mail (using the mail command)? crontab errors should go there usually.
I don't know what user account is configured to get the mail when crontab fails, but usually, it's either root or the defined admin user (whatever that one is called on your system).

You could check the filesizes in /var/spool/mail to see which user got mails.

To read mails from other users, issue:

su - $USERNAME -c mail    (as root)

02 09 * * 1 root echo "crontab running on $(date +"%D") >>/root/crontab.log" && /admin/licenses/bin/demo.sh

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of agriesser
agriesser
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BostonDynamics

ASKER

Turns out a user had an identical line in his crontab, and was locking up the script (he had files open that the root script needed).  Other weeks, root managed to run the script first and the user simply received a permission denied message.  
He put us on the path to discovering the problem.