Solved

cron monitoring

Posted on 2004-08-25
5
992 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
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.

757 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