Article Figure 1 Figure 2 Figure 3 Figure 4
Figure 5 Listing 1 Listing 2 Listing 3 Listing 4 apr2005.tar

Listing 1 sc.sh

#*********************************************************************
# Listing 1
# File: sc.sh
#
# Description:
# This file will:
#
# 1) Email you the savegroup completion report with proper subjects
# 2) Save a history of the SCR on the file system for later review.
#  
# Author: John Ouellette
#
#*********************************************************************

DAY=`date  +%d`
MNTH=`date +%B`
YEAR=`date +%EY`
TIME=`date +%T`

DIR=/nsr/res/savegroups
MAIL=/usr/bin/mailx
RECP=john_ouellette@yahoo.com

##Dump and Setup
cat > $DIR/$$.rpt
GROUP=`cat $DIR/$$.rpt |grep -i savegroup | cut -d" " -f4`
SUBJECT="$GROUP completion report"

##Email
cat $DIR/$$.rpt | $MAIL -s "$SUBJECT" $RECP

##Cleanup and Sort
echo $DIR $YEAR-$MNTH-$DAY-$TIME-$GROUP.rpt

##Make new Dirs and Move SCRs
mkdir -p $DIR/$YEAR/$MNTH
mv $DIR/$$.rpt $DIR/$YEAR/$MNTH/$YEAR-$MNTH-$DAY-$TIME-$GROUP.rpt
rm  $DIR/$$.rpt
#*********************************************************************