Sorry but I forgot to mention that I am doing it in my Solaris machine.
I allocated 600M of disk space for swap mounted on /tmp directory. df on
Solaris will show the /tmp space usage.


Thanks.

On Wed, 2003-01-15 at 09:17, Pablo Manalastas wrote:
> On 14 Jan 2003, lito lampitoc wrote:
> 
> > 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
> 
> I think I'm losing touch here, but on my machine /bin/df shows
> space used and available on each mounted fs partition.  It does
> not show swap space usage.  /usr/bin/free does, however, show
> swap space used and available. Also, what does removing files
> from /tmp have to do with freeing swap space?  What happens to
> critical files in /tmp, like mysql sockets?  Mysql will fail
> when this is done.  Isn't swap part of the virtual memory system
> of Linux, and as such /bin/rm is not the proper tool to manage it?
> 
> P~Manalastas
> 
> _
> 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]
> 
-- 
Lito A. Lampitoc                :  http://www.codewan.com.ph
Systems/Network Administrator   :  CountryWide Wide Area Network, Inc.

As we enjoy great advantages from inventions of others, we should be
glad of an opportunity to serve others by any invention of ours; and 
this we should do freely and generously - Benjamin Franklin                     

_
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