########################################################## # patch_list - creates csv files of patches for each # productline in every environment # J. David SChronce - Wed Apr 25 09:48:44 CDT 2007 ########################################################## # Create a unique directory for outdir ########################################################## outdir=/tmp/patches rm $outdir/* # Get list of Environments for env in `lstver` do . cv $env #pwd # Verify that LAWDIR exists if [ -d $LAWDIR ]; then cd $LAWDIR # Verify that the backup directory exists if [ -d */backup ]; then for Productline in `ls -d */backup \ | grep -v system \ | sed 's/\/backup//g' 2> /dev/null` do # Get patch list if [ -d $Productline/backup ]; then > /$outdir/$LAWENVNAME.$Productline.Patches.csv # Use the Lawson Utility if it's there if [ -f $GENDIR/bin/patches_installed_report ]; then for line in `patches_installed_report $Productline \ | grep -v preview \ | grep -v removal \ | grep -v terminated \ | awk '{print $1,",",$2,",",$6,",",$8}' \ | sed 's/PATCH//g' \ | sed 's/=/equals/g' \ | sed 's/ //g'` do DS=`echo "$line" | cut -d, -f1` TS=`echo "$line" | cut -d, -f2` PATCHNUM=`echo "$line" | cut -d, -f3` STATUS=`echo "$line" | cut -d, -f4` if [ `echo $STATUS | cut -c2-4` = "BUT" ]; then OUTLINE="$DS $TS , $PATCHNUM No Changes" else OUTLINE="$DS $TS , $PATCHNUM" fi echo "$OUTLINE" >> /$outdir/$LAWENVNAME.$Productline.Patches.csv done else # or get data from backup directories # Date, Productline, Patch # (without the extension number) ls -ltd $Productline/backup/* \ | grep -vi "terminated abnormally" \ | grep -v preview \ | awk '{print $6,$7,$8,",",$9}' \ | sed "s/\/backup\//,/g" \ | sed 's/PATCH//g' \ | cut -d"." -f1 \ >> /$outdir/$LAWENVNAME.$Productline.Patches.csv \ 2> /dev/null fi # Show output location echo "Application Patches for $LAWENVNAME $Productline in /$outdir/$LAWENVNAME.$Productline.Patches.csv" fi done fi fi done