Tool for warning user that partition is almost full?

Nigel Henry cave.dnb at tiscali.fr
Fri Mar 24 18:16:19 GMT 2006


On Friday 24 March 2006 16:23, Bo Andresen wrote:
> On Friday 24 March 2006 15:53, Bram Schoenmakers wrote:
> > Op vrijdag 24 maart 2006 15:44, schreef Schimara Marek:
> > > As I said it's not very nice or cool but functional. I use similar
> > > script to monitor and restart my Realplayer as it's prone to crashes
> > > when streaming BBC radio 4 (it doesn't popup anything though). It's
> > > impact on the cpu performance is minimal.
> >
> > A Konsole/xterm with
> >
> > watch df
>
> I don't think that was what Schimara meant. This script will popup a
> message with current output of df -h for the root partition if usage gets
> above 85 %. It polls every 60 seconds.
>
> # Run forever
> while [ 1 ]; do
>  # If 85 (%) less than output of df for root partition popup an x-message
>  [[ 85 -lt `df | awk '$NF~/^\/$/{print $5}' | sed -e 's/\%//'` ]] &&    \
>   xmessage -print `df -h | grep \/$`;
>  # Poll every 60 seconds
>  sleep 60;
> done
>
> But it will not popup if usage does not get above 85 %.

Hi Bo. Thanks for the script. I have a script which someone gave me, to run 
sfxload, to autoload soundfonts to my Audigy soundcard. This is 
in /home/username/.kde/autostart. Will your script run from this location, or 
does it need to be directly run from an open shell?

Secondly, and I'm not deliberately trying to get free shell scripting lessons. 
The drive I've been testing out Kdiskfree with is a FAT32 partition (hdb7) 
that I use for backing up data on, as I use many distro's on this machine. It 
is on fstab so is automounted. What would I need to change on your script to 
get xmessages from this partition when it goes over the limit?

I really must get familiar with writing scripts, but I'm getting a bit old, 
and it's takes a while for stuff to get embedded in my ancient brain.

Nigel.


___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list