Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-25
4
Medium Priority
?
491 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

664 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