Re: Tool for warning user that partition is almost full?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
___________________________________________________
.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux