sumacheck – downloads patches from IBM and send email

Suma (smitty suma) is a pretty cool automated patch downloader for AIX. I tweaked it a little bit to send me emails only when it finds something new. Just put this in cron and don’t worry about the cron setup through suma itself.

#################################################################
# Title      :  sumacheck - Goes to IBM and gets new patches
# Author     :  John Rigler
# Date       :  01-13-2009
# Requires   :  ksh
#################################################################

/usr/suma/bin/suma -x -a RqType=Latest -a Action=Download \
 -a Repeats=n  > /tmp/$$.sumafile

grep SUCCEED /tmp/$$.sumafile > /tmp/$$.sumasuccess

if [[ $? -eq 0 ]]
 then
   mail -s "New Packages from IBM" userid@company.com \
   < /tmp/$$.sumasuccess
 fi

rm /tmp/$$.sumafile /tmp/$$.sumasuccess

Leave a Reply

Your email address will not be published. Required fields are marked *