01-12-2009
102,
0
Join Date: Apr 2008
Last Activity: 11 May 2012, 5:45 AM EDT
Posts: 102
Thanks Given: 0
Thanked 0 Times in 0 Posts
Help on IF
I have a script which looks for two counts (one for today and one for the previous day) if today count is less than yesterdays count to email a check error. see below:
function:
current_members_error()
{
if [ $current_members -lt $MEMBERS_COUNT ]
then
ATTENTION="YES-WARNING *CHECK DATA*"
ATTENTION_REQUIRED="ON"
mailx -r $MAIL_FROM -s "**WARNING: ERROR CHECK**" email address < $MSG_DEST_COUNTS
fi
}
script:
ATTENTION="NON"
OFS=$IFS
IFS=","
while read MEMBERS_COUNT MEMBERS_FILENAME
do
ATTENTION="NON"
#Count todays members
current_members=`wc -l ${DATA_DIR}/$MEMBERS_FILENAME | nawk '{ printf "%d\n", $0}'`
current_members_error
done < $PREV_COUNT
IFS=$OFS
What i want to do is only email me when the count is a different by a 1000? i'm sure you do this in the function where i do the less than but not sure how to do it?
any help would be appreciated