Constipated Ibex
Kyle Smith
kyle.smith at inforonics.com
Thu Apr 9 15:35:30 UTC 2009
Matthew Flaschen wrote:
> Brian McKee wrote:
>
>> On Wed, Apr 8, 2009 at 1:02 PM, Pete Clapham <pc44062 at gmail.com> wrote:
>>
>>> Hi, all --
>>>
>>> My server using Intrepid appears to have a constipated root directory.
>>> Here is the output from the df -h. As you can see, the / drive is 100%
>>> used.
>>>
>> find is your friend.....
>>
>> sudo find / -type f -size +50000k -exec ls -lh {} \; |less
>>
>
> That will only find single files larger than 50000. It won't find, for
> instance, a folder full of 1 MB log files.
>
> I would just do:
>
> du / --max-depth=3
>
> It will take a while to run, but should give you a clearer picture.
>
> Matt Flaschen
>
>
I ran into an issue with my home server filling up, too. It runs my
DHCP and DNS and when those services cant write to their log files they
hang or crash.. leaving my network in rough shape.
I wrote a little ruby script/cron to email my phone when my disk is
filling up:
#!/usr/bin/ruby
free_space = `df -h |grep "/dev/sda"|awk "{print \\$5}"|sed "s/%$//"`
free_space = free_space.to_i
if free_space > 95 then
exit true
else
exit false
end
I execute this script from cron by doing:
*/30 * * * * root /path/to/mon_disk.rb && echo "Disk over 95\%" | mailx
phone_number at txt.att.net -s "DISK FILLING"
In case that helps anyone :)
- Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090409/5c2dac5a/attachment.html>
More information about the ubuntu-users
mailing list