troubleshooting Question

df ksh and exclude a filesystem

Avatar of ethanjohnsons
ethanjohnsons asked on
Unix OS
4 Comments1 Solution1221 ViewsLast Modified:
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

      
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros