The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 01:54 PM
Pull E-mail address from file, send e-mail DC Heard Shell Programming and Scripting 1 01-29-2008 02:23 AM
I am not able to send mail form unix to other mail accounts. chinnigd UNIX for Dummies Questions & Answers 1 04-06-2006 08:31 AM
Hard Disk Check muneebr UNIX for Dummies Questions & Answers 5 08-30-2005 04:37 PM
can not send mail from unix server to company/yahoo mail b5fnpct UNIX for Dummies Questions & Answers 5 11-22-2002 09:24 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-06-2003
foong foong is offline
Registered User
  
 

Join Date: Aug 2003
Posts: 3
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
  #2 (permalink)  
Old 08-06-2003
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,668
if [df|grep|awk > this]; then that.....

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

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

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 726
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0