Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Unix (Automation for Disk space Alert on Server using Shell Script)

Umesh Prasad
03/03/2021 0 0

var=`df -a|grep home|tail -1|awk '{print $3}'`
echo $var1
if [ $var -le 3000000 ]; then
df -h|grep home >data
# du -s /home/* 2>/dev/null| sort -rn |head -20>>data
# cat data|
# mail -s "Alert: Almost out of disk space on $HOST" umesh.prasad@fedex.com
while read line; do

ED=`echo $line|cut -d "/" -f3`
ID=`echo $line|cut -d "/" -f3|cut -c1`

if [ "$ID" == "f" ]

ID1=`echo $ED|cut -c2-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
ID1=`echo $ED|cut -c3-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
done < data

0 Dislike
Follow 2

Please Enter a comment


Other Lessons for You

Amazon written test for experience
For the below written test answer I defined with "*" at the end of the options NULL is the same as 0 for integer the same as blank for character * the same as 0 for integer and blank for character the...

Unix Shell Scripting
UNIX Shell Scripting Unix – An Introduction:- Features & Advantages Unix Vs Linux Unix Architecture File Management Comparative study between Windows & Unix Vi Editor Unix –...

Internal and external commands Linux
Internal and external commands cmd: help To see all available internal commands cmd: type <your cmd> To check your cmd is internal or external.

Shell Scripting - The underrated programming language of system administrators
It is oft repeated that the next wave of IT is automation. But automation is not new - it existed before in terms of automated installation, sending birthday mails etc. It was not untill you actually...

How to check disk group size veritas symantec and volume size script?
#!/usr/bin/kshvxprint | grep Disk |awk {'print $3'} | grep -v rootdg >/var/tmp/dgnameprintf "\n......................................................................\n"printf "Server Name : "hostnamecat...

Looking for Unix Shell Scripting Training classes?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you

Looking for Unix Shell Scripting Training Classes?

The best tutors for Unix Shell Scripting Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Unix Shell Scripting Training with the Best Tutors

The best Tutors for Unix Shell Scripting Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more