don't wait for the 99%

why not try setting it at  >= 85%
an amount which can already  be
considered as critical.




lito lampitoc wrote:

I wrote a very simple bash script to check the capacity of my swap space
for I have a problem of swap space getting full, the script will delete
it's content when it reached 99%, my problem is sometimes it can't
detect 99% because of time interval in cron, I don't want to execute the
script every second because i think it will burden my processor, what do
you think is the possible solution. Here is my simple script:

#!/usr/local/bin/bash

use=`/usr/bin/df -h|grep swap|awk -F" " '{print $5}'`
if use="0%";
then
cat /dev/null 2>&1;
elif use = "99%";
then
/usr/bin/rm /tmp/* > /dev/null 2>&1;
fi

Thanks.




_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]

Reply via email to