Friday, September 16, 2005

script to autosend customer report to Ops & Sys Admin

=========================================
#!/usr/bin/ksh
# script to autosend customer report to Ops & Sys Admin

BASEDIR=/usr/local/mrtg/customer
ZIP=/usr/bin/zip
UUENCODE=/usr/bin/uuencode
MAILTO="opsgroup@abc.com sysadm@abc.com"

TODAY=`date +"%d%m%y"`
cd $BASEDIR
for DIR in `ls -l | egrep "^d" | awk '{ print $9 }'`;
do
FILENAME=$DIR$TODAY
$ZIP -r $FILENAME $DIR > /dev/null 2>&1
$UUENCODE $FILENAME.zip $FILENAME.zip | mailx -s "MRTG Report for $DIR -
$TODAY" $MAILTO
rm $FILENAME.zip
done

0 Comments:

Post a Comment

<< Home