scheduled maintenance
every few months (depending upon system usage) things error out or fail due to a clogged file system. I go through /var/log and archive old logs, or find huge files that got left somewhere, delete them, then everything works fine. short of log cleanup/rotation, I'm looking for a more efficient way to cleanup my filesystems on these occasions.
I have a pretty segregated disc structure:
root /:df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 3.9G 3.4G 384M 90% /
/dev/hda3 8.1G 2.5G 5.1G 33% /data
/dev/hda2 12G 7.2G 4.3G 63% /home
/dev/sda1 2.0G 1.6G 363M 82% /mp3
none 251M 0 251M 0% /dev/shm
/dev/hda7 3.9G 2.3G 1.4G 61% /tmp
/dev/hda5 3.9G 3.1G 719M 82% /usr
/dev/hda6 3.9G 213M 3.5G 6% /usr/local
now / should not be 90% full. more in the 60% ballpark. is there a way I can list the files only in the root fileystem. my thought is something like: ls -Ralhs / but only to include the / fileysystem. I'm sure there is a huge log file, or stdout being stored somewhere that I'd rather not have to dig through each subdir for. in other words, how can I query my system to say, "what are the 10 largest files on this filesystem?"
thanks in advance ;-)
|