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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Please help - disk space check script maddhadder71 Shell Programming and Scripting 0 05-08-2008 09:16 AM
Disk Space Monitoring Script sriram003 Shell Programming and Scripting 8 08-23-2007 12:00 PM
Disk space script asadlone Shell Programming and Scripting 8 06-03-2007 04:32 PM
disk space script debug - posted before bryan Shell Programming and Scripting 3 04-28-2005 08:50 PM
available disk space on disk device??? alan UNIX for Dummies Questions & Answers 4 01-02-2004 03:06 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-01-2006
vivsiv vivsiv is offline
Registered User
  
 

Join Date: Jun 2006
Location: Los Angeles
Posts: 17
Unhappy Frustrating Disk space script

This my frustrating disk space script that is supposed to send me a email whenever the disk space reaches 90% but this has some problem that just would not work ..can anyone please tell me when im going wrong
#!/bin/ksh
sendemail=-1
space=`df -bhk /users/siebelserver |awk '{print$5}'`
echo "$space is the file size percent"
#the statements below did not work, they are supposed to truncate the' % '
#capacity=${space%?}
#capacity=$space|/usr/xpg4/bin/awk -F"[%]" '{ print $1}'
capacity=`$space|sed s/.$//`
echo "capacity is $capacity "
if [ $capacity > 90 ]; then
echo "alert space getting full in $HOSTNAME "
sendemail=1
else
echo "enough space available"
fi
echo $sendemail
if [[ $sendemail > 0 ]]
then
/usr/bin/mailx -s "ALERT: Problem with file space on $HOSTNAME" "vqs@pgou
p.com"
fi
can anyone tellme where im making a mistake..
 

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 05:03 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