The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Send mail attachments and have a mail body shibajighosh AIX 1 04-18-2008 10:54 AM
Pull E-mail address from file, send e-mail DC Heard Shell Programming and Scripting 1 01-28-2008 10:23 PM
I am not able to send mail form unix to other mail accounts. chinnigd UNIX for Dummies Questions & Answers 1 04-06-2006 05:31 AM
Hard Disk Check muneebr UNIX for Dummies Questions & Answers 5 08-30-2005 01:37 PM
can not send mail from unix server to company/yahoo mail b5fnpct UNIX for Dummies Questions & Answers 5 11-22-2002 05:24 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-06-2003
Registered User
 

Join Date: Aug 2003
Posts: 3
Stumble this Post!
Angry how to check my hard disk is below 10%, and then send mail to superuser

how to write bash to superuser, when the disk space dips below 10% of the total by automatically sending an email?
It is have any sample for reference
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-06-2003
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,277
Stumble this Post!
if [df|grep|awk > this]; then that.....

Something along those lines...... just add a bit of thought and your there
Reply With Quote
  #3 (permalink)  
Old 08-06-2003
Registered User
 

Join Date: Aug 2003
Posts: 16
Stumble this Post!
DFR=`df yourfilesystem |grep -v Filesystem |awk '{print $4}'`
if [ $DFR > "90% ]
then
....
else
...
fi
Reply With Quote
  #4 (permalink)  
Old 08-07-2003
pressy's Avatar
solaris cultist
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 712
Stumble this Post!
bash solaris

that should do what you want..... cron it...

#!/usr/bin/bash
DISKUSE=`df -k | awk '{print $5}'`
TEST=`echo $DISKUSE | grep 9[0-9]`
if [ "$TEST" == "" ]
then
exit 0
else
echo "I don't know the mail syntax"
fi
#end


greetings Preßy
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0