I have df -k file system monitor script below. What I need is to exclude /backup filesystem because it is always around 98 or 99%. How do you put the line for excluding the /backup?
bla...
ALERT_ADMIN () { mail -s "${MAIL_SUBJ}" $DIST_LIST << EOF
Filesystem $fsname has reached $sz% of its capacity.
EOF
return
}
cd . > $WORKDIR/freespace.lst
exec 8< $WORKDIR/freespace.lst
df -k | grep -v -i filesystem | grep -v ":" | awk '{print $7,substr($4,1,2)}' |
grep -v "%" | grep -v proc > $WORKDIR/freespace.lst
if [ -f $WORKDIR/freespace.lst ]
then
while read -u8 fsname sz ;
do
if [[ $sz -gt $WARNLEVEL ]]
then
ALERT_ADMIN
fi
done
fi
thx much
bla...
ALERT_ADMIN () { mail -s "${MAIL_SUBJ}" $DIST_LIST << EOF
Filesystem $fsname has reached $sz% of its capacity.
EOF
return
}
cd . > $WORKDIR/freespace.lst
exec 8< $WORKDIR/freespace.lst
df -k | grep -v -i filesystem | grep -v ":" | awk '{print $7,substr($4,1,2)}' |
grep -v "%" | grep -v proc > $WORKDIR/freespace.lst
if [ -f $WORKDIR/freespace.lst ]
then
while read -u8 fsname sz ;
do
if [[ $sz -gt $WARNLEVEL ]]
then
ALERT_ADMIN
fi
done
fi
thx much