Solved

cron monitoring

Posted on 2004-08-25
5
996 Views
Last Modified: 2008-03-17
Is there a way to get a report of which execution of a cron did not happen as planned?

Example: I have a cron job thats scheduled to execute every 5 minutes.
I would like to know if it did run once every 5th minute or did it execute for the first 4 instances and then on no new executions took place

Why I need this : I want to use this to monitor if a job is taking more than its scheduled time or hanging.

Is this approach correct?
Or is there a better way to do this?

Any pointer will be helpful.

cheers!
bitnal
0
Comment
Question by:bitnal
5 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 11890775
have a look at the /var/cron/log file, that will tell you if a cronjob has failed / succeded
0
 
LVL 20

Accepted Solution

by:
Gns earned 40 total points
ID: 11901191
All unices might not have the same "placement" of the logfile... On an AIX near me the file is at /var/adm/cron/log (also linked through /usr/lib/cron). On linux this might vary but a general place is /var/log/cron... On Solaris it is as liddler indicate.

Another approach is to wrap the cronjob in a script that creates a separate logfile.... This is probably the most common solution.

-- Glenn
0
 
LVL 61

Expert Comment

by:gheist
ID: 11906063
Or another approach is to log *.debug to well watched file
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now