Solved

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

Posted on 2008-06-25
4
473 Views
Last Modified: 2010-04-21
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.  

0
Comment
Question by:BostonDynamics
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:agriesser
ID: 21866242
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

0
 
LVL 14

Accepted Solution

by:
agriesser earned 250 total points
ID: 21866254
Argh, scratch my code above, I made quoting errors.
Here's the correct version:

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

Open in new window

0
 

Author Comment

by:BostonDynamics
ID: 21867258
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.  
0
 

Author Closing Comment

by:BostonDynamics
ID: 31470577
He put us on the path to discovering the problem.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Guacamole and browser performance 1 86
App holding yum lock unable to update my rpm package 1 54
nagios alerts 3 44
su - oracle could not open session 6 74
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question