Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mksysb log 1

Status
Not open for further replies.

sendhilk

IS-IT--Management
Mar 29, 2001
109
US


where can i check the log files to find out if my mksysb was successfull or not. if i run it from smit i know i can check smit.log to find out the same but where can i check the logs if i run it from command line?
 
Just type "echo $?" when it is done. Let me attach my "mksysb.sh" script I created. Look at the "log" variable at the end to see what the log filename is.

Regards, Bill.

#! /bin/ksh
#
# Program to run mksysb
#

validate() {

if [ "$tape_drive" = "" ] ; then
tape_drive="/dev/rmt0"
fi

if [ ! -r $tape_drive ] ; then
echo "Unknown tape drive specified - $tape_drive"
a=1
fi

}

getcfg() {
drive=`basename $tape_drive`
make=`lscfg -vl $drive|grep Manufacturer|cut -c37-50`
model=`lscfg -vl $drive|grep Model|cut -c37-50`

}

doit() {
echo "####################################################################"
echo "mksysb on $node begins `date`"
echo "I will be using tape drive: $tape_drive"
echo "Which looks like a $make $model"
echo "####################################################################"
chdev -l $drive -a block_size=0
if [ -r $ex ] ; then
/usr/bin/mksysb -m -e -i -p $tape_drive
rc=$?
else
/usr/bin/mksysb -m -i -p $tape_drive
rc=$?
fi
echo "mksysb on $node completed `date`"

}

cleanup() {

cat $errlog >> $log

if [ "$rc" -eq "0" ] ; then
cat $log |mail -s "mksysb completed successfully on $node on $dispdate" root
else
cat $log |mail -s "mksysb FAILED on node $node on $dispdate" root
fi
mt -f $tape_drive rewoffl
rm $errlog

}

tape_drive=$1
date=`date +%Y%m%d`
dispdate=`date +%m/%d/%Y`
log="/var/mksysb.$date"
errlog="/var/mksysb.$date.err"
touch $log
touch $errlog
node=`hostname`
exec 1>$log 2>$errlog
ex="/etc/exclude.rootvg"
a=0

validate

if [ "$a" -eq "1" ] ; then
echo "error NO_DEV for $node mksysb - ERROR"
rc=1
cleanup
exit 1
fi

getcfg
doit
cleanup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top