Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2011 20:21:45 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Ryuichiro Hara <rhml@kibug.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Simple command to reset / clear all logs?
Message-ID:  <20110112202145.515b24b3.freebsd@edvax.de>
In-Reply-To: <4D2DE216.6040505@kibug.org>
References:  <AANLkTimMvTxsdRXhxzXwjdTDzQ5U7m7kzVc0orGwxM5U@mail.gmail.com> <4D2DE216.6040505@kibug.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 13 Jan 2011 02:17:10 +0900, Ryuichiro Hara <rhml@kibug.org> wrote:
> Hello,
> 
> It might be all right to remove all "normal file" logs,
> though you may want to retain all subdirectories.
> 
> find /var/log -type f -exec rm {} \;
> 
> may do.

Possible problem: Programs that log to files may be confused
that the file has disappeared. How about simply cutting the
files to zero length?

	# cat /dev/null > /var/log/*

This will affect ALL files (expansion of *) which may not
be precise enough in case you want to keep some of the
log files.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110112202145.515b24b3.freebsd>