Low disk space warning

I’ve been using OSMC for awhile now, what seems to be missing for me is a disk space warning. I had OSMC crash twice without me realising that it didn’t have any space to work with. It might have been a plugin trying to write without checking the space first but still a little system warning would’ve been nice!

1 Like

try monit

Good suggestions.

Added to development backlog.

Thanks.

1 Like

Can than also be included a “clear temp/log/…” now?

To somehow solve my own problem I created a small bash script and added it as a cron job.
It runs every 10 minutes checking for free disk space on / and sends a notification to Kodi on screen about it. OSMC handles that really nicely :wink:

I can’t seem to add an icon to the on-screen notification, I think that OSMC’s theme just doesn’t support it…

So here’s my script:

Note: The script is not a complete solution, it’s just something I wrote in 10 minutes to help out.

#!/bin/sh

warningLimit=1048576; # Warn when less than 1GB left.
freeSpace=`df / | awk 'NR==2{print $4}'`

if [ "$freeSpace" -lt "$warningLimit" ]
then
 kodi-send --action="Notification(Low Disk Space,/ has only $(($freeSpace/1024))MB left.)"
fi
1 Like

/temp/ gets cleared on reboot, and kodi/temp logs get erased by rebooting twice.