You are not logged in.
Pages: 1
Hi folks,
A few times I've unexpectedly completely exhausted the space on my primary drive. In fairness, the system has been great: hasn't spectacularly crashed or whatever. But I'd like to avoid this happening without me having any warning.
This answer is promising but defunct. Is there any package, existing setting, or simple script I could run to do this?
I'm happy to try to do something in bash & cron - notwithstanding a general poor ability - but I wanted to check whether something already exists 'off the shelf' as it were.
Cheers y'all!
Offline
There is the xfce4-fsguard-plugin that can alert you when usage limits are reached. You can place multiple instances of these on the panel.
Alternatively, if you're looking for a script to run:
#!/usr/bin/env bash
# Used Space Trigger - at what % of used space do you want to be notified
USTRIGGER=90
# the partition you want to monitor
PART=/dev/mmcblk1p2
# the amount of time between checks in seconds
CHECK=60
# don't run script if already running
if [ $(ps -ef | grep $0 | grep -v grep | wc -l) -gt 2 ]; then
exit 1
fi
while true
do
USEDSPACE=$(df -h | grep "$PART" | awk '{print $5}' | tr -d '%')
if [ $USEDSPACE -ge $USTRIGGER ]; then
notify-send -i disk-quota-low "Low Space Warning" "You have allocated $USEDSPACE% of disk space on $PART"
fi
sleep $CHECK
done
exit 0
....adjust the first 3 variables in the script to suit.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
What would we do without you bud?
Thanks, as always, and have a cracking weekend. Cheers!
Offline
Several years ago, I worked with a hardware engineer whose advice was to never allow your disk to exceed 70% capacity. If it did, it was time to get a larger disk.
Do no harm.
Offline
Cheers him610. I wonder if that general principle still holds as drives have become larger?
My usage hasn't changed much - I add new music infrequently but it's still the same filesize per minute which means it's gotten relatively cheaper and less problematic to store compared to the drives themselves. Video has moved to streaming meaning no ongoing storage need. Pictures continue to add up, but they don't weigh much. Videogames are huge but all can be uninstalled when not in use, and I barely get the chance to play anyway. Office files are generally small, and compress well when not in use.
All this to say: my total drive usage % has crept up over the years, but with a bit of management I can defer any purchasing need for another couple of years at least. The issue for me is not cost, but faff: when I upgraded my PC a few years ago I inadvertently used cables from my older PSU on my newer PSU (same brand); due to undocumented internal wiring differences, when I turned on the machine, it insta-fried 3 HDDs & 1 SDD. Now I'm on 2 x 2tb NVME/M2s which need no cables, but when they're full, I've got a tech decision to make that I'd be quite happy to ignore for another 10 years!
Offline
Pages: 1
[ Generated in 0.013 seconds, 10 queries executed - Memory usage: 535.66 KiB (Peak: 536.5 KiB) ]