I want to write some type of script that will run as a cron job every night 
after the logs roll over.  It will do the following (excuse the pseudocode, 
it's the best way I can explain all of this).

[EMAIL PROTECTED]
MAILFILE=mail.tmp

Set $DATE with date +"%Y%m%d"
cp access_log.1 to $DATE.log

echo "From: [EMAIL PROTECTED] (nobody)" > $MAILFILE
echo "To: $SENDER" >> $MAILFILE
echo "Subject: Log files: $DATE" >> $MAILFILE #where date is the variable; 
excuse my horrible syntax if that doesn't work
echo "\n" >> $MAILFILE

sendmail -t $SENDER < $MAILFILE and with $date.log attached

I guess I need to do some perl work for this one.  Help would be appreciated.

Thanks,
Bill




Reply via email to