Tool for warning user that partition is almost full?

Bo Andresen bo.andresen at gmail.com
Fri Mar 24 15:23:15 GMT 2006


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 %.

-- 
Bo Andresen
___________________________________________________
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