I use this because I don't like the free disk space on the task bar. I have Puppy installed on a 100G drive....
Works great for me and I thought I would share.
Use the pet or use the tar.gz and untar it in your /root/Startup folder to run at each startup.
Code: Select all
#!/bin/sh
# dfwarn - Low Disk Space Warning v0.0.2
# Copyright 2008 Brad Coulthard, email in below file (trying to avoid spam)
limit="100" # Where we give a warning in MB's
quiet="0" # If warned don't do it over and over..
while [ 1 ];do
dfget=$(df -h | grep rootfs | cut -c 35-38) # Full text of freespace -> 110G
mod=${dfget:(${#dfget}-1)} # The last part -> G
nub=${dfget:0:(${#dfget}-1)} # frist part -> 110
if [ $dfget = "0" ]; then # If diskspace is 0
Xdialog --msgbox "!!! OUT OF DISK SPACE !!!\nAddress this NOW or your system WILL crash!!" 10 60
fi
if [[ $nub -lt $limit && "$mod" = "M" && "$quiet" = "0" ]]; then # If diskspace is below Limit (above)
Xdialog --msgbox "There is ${nub}M free on your disk.\nFree up some space to avoid a crash!" 10 40
quiet="1"
fi
sleep 10
done