SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Currently I am running gkrellm for the sole reason to monitor disk space. When a partition reaches 95% full the pc will be halted to prevent data loss.
I'd like to get rid of gkrellm, but want to keep monitoring disk space. Is there an elegant way to do this? Maybe through conky (fork of torsmo)? Surprisingly google nor LQ came up with anything.
You could have a cron job check for the space left periodically.
percentleft=$(df / | tail -n 1 | tr -s ' '| cut -d' ' -f5)
if [ ${percentleft%\%} -lt 5 ]; then shutdown -s 500 -h +5 'Disk space critical'; fi
Using quotas may be a more elequent way to handle this.
Thanks, but what I had in mind was more a kind of real-time monitoring. So that it will notice a near-full partition when copying large amount of files, or ripping a DVD.
I believe that using quotas you could have a soft limit and a hard limit. On the softlimit you are warned immediately and on a hard limit, you aren't allowed to continue (save the file).
This may work better if you are on a system with several users.
You might read through the ulimit man page. In any case I think that a warning, perhaps using xwindow, would be better than a shutdown.
A program that would do this, ( perhaps there are some ), may get the info from the kernel and run as a service. There may be a kernel feature for this. You could try googling for terms like "disk limit kernel alarm". You could also look at the source for gkrellm and gut it out, removing the display code and retaining the monitoring and action parts of the code.
Someone else on this site probably knows of the perfect program for you!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.