totaldiskspace.ksh

#
# Title :       totaldiskspace.ksh
# Description : Add up total configured,
#               available and used disk space.
#
# Copyright :   ABCdba.com 2010
#

startval1=0
for i in `df -ek|sed '1d'|awk '{print $2 }'`
do
startval1=`expr $startval1 + $i`
done

startval2=0
for j in `df -ek|sed '1d'|awk '{print $3 }'`
do
startval2=`expr $startval2 + $j`
done

startval3=0
for k in `df -ek|sed '1d'|awk '{print $4 }'`
do
startval3=`expr $startval3 + $k`
done

echo
echo
echo $startval1|awk '{printf "Total Disk Space Configured is: %15s kb\n",$1}'
echo $startval2|awk '{printf "Total Disk Space Used is:       %15s kb\n",$1}'
echo $startval3|awk '{printf "Total Disk Space Available is:  %15s kb\n",$1}'
echo
echo
© copyright 2001-2014 ABCdba.com | all rights reserved