Would like to see how others would do this...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Would like to see how others would do this...
# 15  
Old 06-12-2007
Can anyone help finish this with .sh code?
Thanks!
# 16  
Old 06-13-2007
Quote:
SIMPLE RULES OF THE UNIX FORUMS:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.
The bourne shell vesion of my previous script :
Code:
#!/usr/bin/sh

usage=50
time_limit=3

set -- `sed  -n 's/.*\([0-9]\+\)%.*\([0-9][0-9]\):[0-9][0-9]:[0-9][0-9].*/\1 \2/;T;p' out.txt`
percentage=$1
hours=$2

echo "${percentage}% ${hours}h"

if [ $percentage -gt $usage ] ;then
   echo "Disk usage beyond $usage%"
   #send mail
fi

if [ $hours -gt $time_limit ] ;then
   echo "Time limit beyond $time_limit hours"
   #send mail
fi

Jean-Pierre.
# 17  
Old 06-13-2007
Sorry about the "bump up", just hoping to get something that works, that I understand... i'll watch it in the future!
Thanks Jean-Pierre!
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question