[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] clear files for space
- Subject: Re: [cobalt-developers] clear files for space
- From: "John P. Looney" <valen@xxxxxxxxxx>
- Date: Wed Aug 21 01:29:03 2002
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
On Tue, Aug 20, 2002 at 04:03:53PM -0400, njd76 mentioned:
> What's the easiest way to clear my log file on my box to free some space
> up? And what log files should I keep and which ones should I delete?
>
> Any help is appreciated!
For the benefit of my optimising-loving friend, the quickest way of
truncating a logfile is:
> /var/log/filename
the '>' symbol instructs the shell to open the file for writing, and will
truncate it in the process. Never 'rm' a logfile - this will only remove
the filename from the directory - the file will stay open, and be written
to on disk, until syslog (or whatever process has it open) closes. So "du"
will tell you that /var/log is using up little space, but "df" will tell
you differently!
As to what to keep...that's up to you. Have a look in the log files, and
see do they look interesting. Nuke them if they don't. That said, you
should have some sort of logrotate script going, so that will keep them
trim.
Have a look in /etc/logrotate.d for the configuration of 'logrotate'. You
can set it up so that your messages file is never more than 1MB, etc.
Kate