#! /bin/csh
#
# Name: alert
#
# Description: Checks each instrument's *_file table
#              for any deliveries that have missing opus_load_date or 
#              archive_date values.  Generates a report for each reference
#              file DB entry in that state, and sends e-mail to 
#              $CDBS_EMAIL_DISTRIB if any are found.
#
# Called by:   nothing (stand-alone tool)
#              This task used to run as part of a nightly CRONTAB,
#              but no longer does.
#
# History:
# xx/xx/xx  SLubow      original
#----------------------------------------------------------------------------
#
# first run it to see if any problem cases are found, and if none are just exit
if ( `alert_a.s | grep "-" |  wc -l` < 1) exit >& /dev/null
#
# run again, this time mailing the output of the problem cases found
#
alert_a.s | grep "-" | mail -s"Not yet in Bestref" ${CDBS_EMAIL_DISTRIB}
