





du | sort -nr | more


Chewearn wrote:Pre-requisite
In order for the pop-up message to appear, you would need to install “libnotify-bin”.
- Code: Select all
sudo apt-get install libnotify-bin
Script
The script will check the free disk space in “/dev/sda1″. It will show a pop-up message for 30 seconds when the free space is below 100MB. If the free space is below 50MB, it will show a pop-up message for 5 minutes. You should modify these parameters to your own requirement.
Copy and paste the script below to a file called “checklowdisk”.
- Code: Select all
#!/bin/sh
DISKSPACE=`df | grep "/dev/sda1" | awk '{ print $4 }'`
if [ "$DISKSPACE" -lt "51200" ] ; then
/usr/bin/notify-send -u critical -t 300000 \
'Check low disk' '/dev/sda1 is less than 50MB.'
exit
fi
if [ "$DISKSPACE" -lt "102400" ] ; then
/usr/bin/notify-send -u normal -t 30000 \
'Check low disk' '/dev/sda1 is less than 100MB.'
fi
Setting up the script
Make the script executable:
- Code: Select all
chmod +x checklowdisk
Change file ownership to root:
- Code: Select all
sudo chown root:root checklowdisk
Move file to “/usr/bin”:
- Code: Select all
sudo mv checklowdisk /usr/bin/
Set-up crontab
I chose to run the script hourly using crontab.
Edit crontab:
- Code: Select all
crontab -e
Add this line in the editor:
- Code: Select all
00 * * * * env DISPLAY=:0 /usr/bin/checklowdisk
Save and close the editor. The crontab is now configured, and the script will run at the hour.




Version_3 wrote:Not sure about a program that does it. I use Conky to monitor percentages.
However, when I feel I need to do some clean up, I hop into Terminal and run the command
- Code: Select all
du | sort -nr | more
This will give you a listing of disk usage in the order of largest to smallest. Great for locating what's really taking up room, and not as time consuming as looking via Nautilus.
du -h | sort -nr | more89K ./.mozilla89268 ./.mozilla


Jerther wrote:My girlfriend's laptop started doing strange things and crashing programs until I read one of the crashed program error: Disc is full, but that was after she lost all her torrents in Deluge...
So I did a little clean up and everything is back to normal. But besides the error message, she claims seeing no warning of low disc space.
Isn't Mint (or any OS at all) supposed to warn when system disc is becoming low?






Mozenrath wrote:Here's a little advice I have. I don't know how technically sound it is, but just hear me out.
If you get a low disk space warning, and it doesn't make sense or the evidence says otherwise, back your files the heck up immediately and don't turn off your computer!
Last time this happened to me I didn't back up my files, and when I turned my computer back on it wouldn't boot. My drive was corrupted and I couldn't practically get anything back. Backing up is a good precaution.

Jerther wrote:... But besides the error message, she claims seeing no warning of low disc space.
Isn't Mint (or any OS at all) supposed to warn when system disc is becoming low?

Users browsing this forum: Bing [Bot], Google Adsense [Bot], InkKnife, kazbah and 23 guests