[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] root partition is at 93%
- Subject: Re: [cobalt-users] root partition is at 93%
- From: "Steve Werby" <steve-lists@xxxxxxxxxxxx>
- Date: Tue Nov 26 12:08:00 2002
- Organization: Befriend Internet Services LLC
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
<rdkurth@xxxxxxxxxxxx> wrote:
> My /dev/hda1 (root) partition is at 93% is there a command line Command
that
> will show me what is filling up this partition. I need to stop it
> before it kills my server.
find. man find. Here's a script I wrote that checks the entire server for
files over 1 million bytes and saves their directory listings to a log file
sorted in reverse order of filesize. It should tell you what you need.
Feel free to edit as necessary. YMMV and I'm not liable for anything that
happens if you use the script, though it works for me on numerous servers.
#!/bin/sh
LOG_FILE_DIR=/home/log/large_files
# 1 million bytes is ~ 1 MB.
SIZE_BYTES=1000000
[ -d $LOG_FILE_DIR ] || mkdir -p $LOG_FILE_DIR
DATE_TODAY=`date "+%Y-%m-%d"`
find / -size +"${SIZE_BYTES}c" -type f -exec ls -l '{}' ';' | sort +4 -nr >
$LOG_FILE_DIR/large_files-$DATE_TODAY
chown -R admin:admin $LOG_FILE_DIR
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/