Sponsored Content
Full Discussion: cron's irregular responds
Operating Systems Linux Red Hat cron's irregular responds Post 302523629 by sriniv666 on Thursday 19th of May 2011 08:40:07 AM
Old 05-19-2011
cron's irregular responds

hi,
i ve constructed a script to monitor the crond ,if the crond service is not available/not running then a mail ll be sent the mention mail id.. here the code

Code:
crond=`service crond status|grep pid |awk '{print $5}'|cut -c1-7`
if [ "$crond" != "running" ];
   then
   echo -e "the CRON jOb is currently offline" | mail -s " ******CRONTAB ALERT*******" srini@yyyyyyyyy.com
fi

then i ve given the entry for cron as
Code:
* * * * * /usr/local/myscripts/cronstatus.sh

Now the issue is though the crond is running me getting the alert each minute. Where im going wrong Smilie

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability. Also please refrain from overly use of font formatting, thanks.

Last edited by zaxxon; 05-19-2011 at 09:44 AM.. Reason: code tags, fonts etc.
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

How to convert irregular lines into formatted column using awk in windows2003 server environment?

Dear experts, I'm newbie to awk scripting. Need your great help to convert the irregular lines into column using awk in windows2003 server environment. (Sorting based on "Pri Number" column) Input files is as follows: Partition Name: OA Partition UID: ... (0 Replies)
Discussion started by: ruirus
0 Replies
CALENDAR(1)						      General Commands Manual						       CALENDAR(1)

NAME
calendar - reminder service SYNOPSIS
calendar [ - ] DESCRIPTION
Calendar consults the file `calendar' in the current directory and prints out lines that contain today's or tomorrow's date anywhere in the line. Most reasonable month-day dates such as `Dec. 7,' `december 7,' `12/7,' etc., are recognized, but not `7 December' or `7/12'. On weekends `tomorrow' extends through Monday. When an argument is present, calendar does its job for every user who has a file `calendar' in his login directory and sends him any posi- tive results by mail(1). Normally this is done daily in the wee hours under control of cron(8). FILES
calendar /usr/lib/calendar to figure out today's and tomorrow's dates /etc/passwd /tmp/cal* egrep, sed, mail subprocesses SEE ALSO
at(1), cron(8), mail(1) BUGS
Your calendar must be public information for you to get reminder service. Calendar's extended idea of `tomorrow' doesn't account for holidays. CALENDAR(1)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy