Hi Gurus
I have several SAN's in two different locations. I collect performance data and archive them. In one location the archiving script runs on a solaris 9 server and in the other on a solaris 10 server. But the script fails every day on the solaris 10 server with this
mes6=`/usr/bin/du -sk *${yesterday}* | /usr/bin/awk '{print $1}'`
I tried everything, even a redirect to a /tmp/output.txt to see what the output is. It is always 0
#!/usr/bin/sh
date=`date +'%Y%m%d'`
#yesterday=`expr $date - 1`
yesterday=`perl -e '@T=localtime(time-86400);printf("%02d%02d%02d",$T[5]+1900,$T[4]+1,$T[3])'`
dir=`date +'%m%y'`
host=`uname -n`
set -x
test ! -d $dir && mkdir $dir
cd /var/tmp/performance/controller
tar cvf controller_$yesterday.tar *${yesterday}*.txt
mes1=`tar tvf controller_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
cd archive/$dir
mes4=`du -sk *${yesterday}* | awk '{print $1}'`
cd /var/tmp/performance/controller
rm *${yesterday}*.txt
cd /var/tmp/performance/volume
tar cvf volume_$yesterday.tar *${yesterday}*.txt
mes2=`tar tvf volume_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
cd archive/$dir
mes5=`du -sk *${yesterday}* | awk '{print $1}'`
cd /var/tmp/performance/volume
rm *${yesterday}*.txt
cd /var/tmp/performance/array
tar cvf array_$yesterday.tar *${yesterday}*.txt
mes3=`tar tvf array_$yesterday.tar | wc -l`
/usr/bin/gzip *.tar
test ! -d archive/$dir && mkdir archive/$dir
/usr/bin/mv *.tar.gz archive/$dir/
cd archive/$dir
mes6=`/usr/bin/du -sk *${yesterday}* | /usr/bin/awk '{print $1}'`
echo $mes6 >> /tmp/output.txt
cd /var/tmp/performance/array
rm *${yesterday}*.txt
#send a webops message if too less files
if [ $mes1 -lt 720 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes1 controller messages on $host, check script"
fi
if [ $mes2 -lt 720 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes2 volume messages on $host, check script"
fi
if [ $mes3 -lt 720 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes3 array messages on $host, check script"
fi
#send a webops message if .tar.gz is too small in size
if [ $mes4 -lt 250 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes4 kb controller messages on $host, check script"
fi
if [ $mes5 -lt 250 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes5 kb volume messages on $host, check script"
fi
if [ $mes6 -lt 33 ]; then
/usr/local/bin/webopsmsg.pl -s 4 -m "Only $mes6 kb array messages on $host, check script"
fi
So I have everyday webops messages and tickets.
Can you tell me whats wrong? Is it a problem with the solaris 10 server? On the solaris 9 server it runs without any probem.
Thanks in advance for your input.
gnom