Re: Detecting failing cron jobs
- From: "ynotssor" <ynotssor@xxxxxxxxxxx>
- Date: Sun, 29 Apr 2007 10:04:59 -0700
In news:1177828761.136128.91150@xxxxxxxxxxxxxxxxxxxxxxxxxxx,
Terminator <manidevarajan@xxxxxxxxx> wrote:
I have 10+ cron jobs running to do various check and alert if some
condition detected. But once in a while cron job itself doesnt
complete successfully due to "cant open a log file" or so. What would
be ideal way to find some cron job didnt go thru successfully.
Should i write one more cronjob to test all other cron jobs, and
alert even if one of them fails.
In general, without knowing the exact nature of your crontab entries, you
might wish to append the following (using a semi-colon) after each crontab
entry of interest:
if [ $? -ne 0 ]; then echo "cron job failed"; fi
This will cause crond to send an email with the subject line being the cron
job which failed.
.
- References:
- Detecting failing cron jobs
- From: Terminator
- Detecting failing cron jobs
- Prev by Date: Re: Detecting failing cron jobs
- Next by Date: Re: Detecting failing cron jobs
- Previous by thread: Re: Detecting failing cron jobs
- Next by thread: Re: Detecting failing cron jobs
- Index(es):
Relevant Pages
|
|