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
apticron(1)						      General Commands Manual						       apticron(1)

NAME
apticron - Generate a mail listing packages which are pending an upgrade SYNOPSIS
apticron [--cron] DESCRIPTION
apticron is a shell script which generates a mail with a list of all packages currently pending an upgrade, as well as summary of changes - using apt-listchanges - to a configurable Email address. apticron is mainly intended for automatic notification of pending security updates but can also be used in many other situations where timely updates are necessary. The --cron option is only meant to be used when invoked by cron in order to run no more than once a day. FILES
/etc/apticron/apticron.conf Configuration file, Email address to mail and profile for use with apt-listchanges are configurable. /etc/cron.d/apticron Cron job for executing apticron daily. /etc/cron.daily/apticron Fallback cron script for executing apticron (if no crond running or system down at designated time). /var/lib/misc/apticron.cron Time stamp file used by apticron when invoked with --cron option. SEE ALSO
apt-get(8), apt-listchanges(1), cron(8) AUTHOR
Apticron was initially developed by Colm MacCarthaigh <colm.maccarthaigh@heanet.ie> with contributions from Marc Sherman <msherman@projec- tile.ca>. Since 2006 it is maintained and improved by Tiago Bortoletto Vaz <tiago@debian.org>. apticron(1)
All times are GMT -4. The time now is 08:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy