Solved

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

Posted on 2008-06-25
4
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

635 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