telemorgan
MIS
good morning everyone, need some assistance please.
I am looking to write a script to take each partition and do a disk space check to see if the used space is over 98% of the disk. This is what I have.
par="u01 u02 u03 u04 u05 u06 rootvol"
size=""
for y in $par ; do
df -k | grep $y | awk '{print $5}' | nawk -F '%' '{print $1}' > $size
if [ $size -ge "98" ]; then
echo "$par is growing out of control" >> $MYMSG
else
goto EXIT
fi
done
when run, i am getting this error. is there another way to do this??
./tt2[7]: test: argument expected
73
./tt2[7]: test: argument expected
64
./tt2[7]: test: argument expected
70
./tt2[7]: test: argument expected
53
./tt2[7]: test: argument expected
91
./tt2[7]: test: argument expected
13
./tt2[7]: test: argument expected
I am looking to write a script to take each partition and do a disk space check to see if the used space is over 98% of the disk. This is what I have.
par="u01 u02 u03 u04 u05 u06 rootvol"
size=""
for y in $par ; do
df -k | grep $y | awk '{print $5}' | nawk -F '%' '{print $1}' > $size
if [ $size -ge "98" ]; then
echo "$par is growing out of control" >> $MYMSG
else
goto EXIT
fi
done
when run, i am getting this error. is there another way to do this??
./tt2[7]: test: argument expected
73
./tt2[7]: test: argument expected
64
./tt2[7]: test: argument expected
70
./tt2[7]: test: argument expected
53
./tt2[7]: test: argument expected
91
./tt2[7]: test: argument expected
13
./tt2[7]: test: argument expected