print disk space warning of 70%


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting print disk space warning of 70%
# 1  
Old 10-17-2008
print disk space warning of 70%

Hi All,

I have a script that run every night to check disk space.

echo "Warning: Disk with 70%~79% used" && df -k | grep [7].%

I want the echo should go out only if there's a FS usage findings of 70%+. I want a simple shell script, not with if and then script.

Thank you for any comments you may add.
# 2  
Old 10-17-2008
try
Code:
df -k | grep '%' | awk '($1>69)?$0="FOUND":$0=""' |grep -q 'FOUND' && echo "disk 70% and greater"

This finds anything > 69%: 70 - 100.
This User Gave Thanks to jim mcnamara For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How much disk space?

Hi, I have this : uname -a Linux servername 2.6.18-194.11.3.el5PAE #1 SMP Mon Aug 23 15:57:10 EDT 2010 i686 i686 i386 GNU/Linux df -k Sys. de fich. 1K-blocs Occupied Disponible Capacity Monted on /u01/applis 10321208 3190160 6606760 33% /applis Does it mean... (1 Reply)
Discussion started by: big123456
1 Replies

2. Red Hat

disk space

when i check /export directory of my machine gets filled up (85%) i removed some old logs. but after cleaning df -k command still shows that /export is still 85% full. Is there a way to force df to reflect actual free space without rebooting? My machine is a production one and can't... (8 Replies)
Discussion started by: aboorkuma
8 Replies

3. Shell Programming and Scripting

Disk Space

Hi This is my script for disk space monitoring clear if then echo "You must be root user to execute the script" fi ALERT_LEVEL=10 CONSUMPTION_LEVEL= `df -k | awk {'print $5'} | cut -d '%' -f1 | sed "1 d"` for i in $CONSUMPTION_LEVEL do FILE_SYSTEM=`df -k | awk {'print $1'} |... (3 Replies)
Discussion started by: chrs0302
3 Replies

4. Filesystems, Disks and Memory

disk space

Hello All- Am new member to this forum. Have some unix experience. But true believer in it compared to windows. Have a question regarding the disk space. I know a command to check the total disk space utilization using: df -k . but what is the command to check the same disk space by... (6 Replies)
Discussion started by: milkyway
6 Replies

5. Solaris

Disk space?

I'm a Unix newbie running Solaris 9. After installing a fresh copy on a 40GB drive I noticed the available disk space is 2% free or approximately 200MB available. Is that possible? Did I do something wrong? (4 Replies)
Discussion started by: jbarbuto
4 Replies

6. UNIX for Dummies Questions & Answers

available disk space on disk device???

Hello, Can someone please tell me which command to use to determine the available disk space on a given disk device? I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be? Thanks in advance! Al. (4 Replies)
Discussion started by: alan
4 Replies

7. Filesystems, Disks and Memory

Disk Space -

I know I have posted this question before, but I still just don't understand how to determine disk space. This server is an IBM RS6000 running on AIX version 4.2.1. I in essence need to know the following if anyone can assist me. 1) I need to know how many drives are configured in the... (2 Replies)
Discussion started by: Docboyeee
2 Replies

8. Filesystems, Disks and Memory

Disk space

Can someone tell me how to determine how much disk space has been allocated to me and how much of it I am using? Thanks in advance. (1 Reply)
Discussion started by: jxh461
1 Replies

9. UNIX for Dummies Questions & Answers

Out of disk space?

Hi I'm trying to install gcc and the installation program tells me that I'm out of disk space! I have just installed the os (using the default settings for partitions and sizes) and have only installed apache on the machine. Can it really be out of disk space already? How do I check how much... (4 Replies)
Discussion started by: alfabetman
4 Replies
Login or Register to Ask a Question