IF statemnet with DF -h command

  • Thread starter Thread starter kunalks
  • Start date Start date
K

kunalks

Hello
I have on equestion that i want to check the disk space of mounted drive

df -h /path to drive and then i want to write a script which will genrate a messsage if drive space will be above 80% .

means
script how i can make if condition which for drive space .

if (df -h /path to drive <= 80 %); then
echo "it has only 20 % left"
else
null
fi
can some one help me with this ?


thanks in advanced

Continue reading...
 
Back
Top