On Mon, Sep 09, 2002 at 08:46:19PM -0500, Bill Sawyer wrote:
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
If the destination is ultimately another Linux system, then you
might want to just look into running syslog to log on the
destination server.
Otherwise, I would suggest you look into logcheck. It generally
only sends interesting logs, but could be configured to send
everything.
--
Don Bindner [EMAIL PROTECTED]