Re: Mail script help

From: Willeat, Todd (TWilleat@MHP.SMHS.COM)
Date: Thu Jun 27 2002 - 17:27:42 EDT


Here's what I run at 11:59p to only get that day's errors:

#!/bin/ksh

#Emails any errors for current day

MM=$(/usr/bin/date +%m)

DD=$(/usr/bin/date +%d)

YY=$(/usr/bin/date +%y)

ERRPTDATE=$(echo $MM$DD"0000"$YY)

/usr/bin/errpt -a -s $ERRPTDATE|/usr/bin/Mail -s "Error report for
$(hostname) at $(date)" user@someplace.com

-----Original Message-----
From: antfio@MUZE.COM [mailto:antfio@MUZE.COM]
Sent: Thursday, June 27, 2002 4:08 PM
To: aix-l@Princeton.EDU
Subject: Mail script help

Hello all,

        I'm thinking of having a cronjob email me the output of errpt
sometime in the morning. Would this syntax work?

        errpt | mail -s "Errpt for xyz" user@someplace.com

TIA,

Anthony



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:01 EDT