From owner-freebsd-questions@FreeBSD.ORG Wed Jan 12 19:21:48 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86463106566C for ; Wed, 12 Jan 2011 19:21:48 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 488658FC18 for ; Wed, 12 Jan 2011 19:21:48 +0000 (UTC) Received: from r55.edvax.de (port-92-195-143-131.dynamic.qsc.de [92.195.143.131]) by mx02.qsc.de (Postfix) with ESMTP id A29F91DD20; Wed, 12 Jan 2011 20:21:46 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p0CJLjZ5001466; Wed, 12 Jan 2011 20:21:45 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 12 Jan 2011 20:21:45 +0100 From: Polytropon To: Ryuichiro Hara Message-Id: <20110112202145.515b24b3.freebsd@edvax.de> In-Reply-To: <4D2DE216.6040505@kibug.org> References: <4D2DE216.6040505@kibug.org> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Simple command to reset / clear all logs? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 19:21:48 -0000 On Thu, 13 Jan 2011 02:17:10 +0900, Ryuichiro Hara 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, ...