From owner-freebsd-questions Sun Dec 31 17:26:23 2000 From owner-freebsd-questions@FreeBSD.ORG Sun Dec 31 17:26:21 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from grumpy.dyndns.org (user-24-214-56-41.knology.net [24.214.56.41]) by hub.freebsd.org (Postfix) with ESMTP id BAE6437B402 for ; Sun, 31 Dec 2000 17:26:20 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by grumpy.dyndns.org (8.11.1/8.11.1) with ESMTP id f011QHQ09814; Sun, 31 Dec 2000 19:26:17 -0600 (CST) (envelope-from dkelly@grumpy.dyndns.org) Message-Id: <200101010126.f011QHQ09814@grumpy.dyndns.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Jorge Biquez Cc: freebsd-questions@FreeBSD.ORG From: David Kelly Subject: Re: Newsyslog for rotating APACHE logs In-reply-to: Message from Jorge Biquez of "Sun, 31 Dec 2000 15:38:30 CST." <5.0.2.1.2.20001231153034.01c780c0@intranet.com.mx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 31 Dec 2000 19:26:17 -0600 Sender: dkelly@grumpy.dyndns.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jorge Biquez writes: > Hello all. > > I'm still on the rotation files. I wanted to try newsyslog before going for > the scripts paths since seems could be simpler. > This is what I have on the newsyslog.conf file: > > # logfilename owner.group mode count size time [ZB] > [/pid_file] [sig_num] > /var/log/maillog 664 7 * 24 Z > /var/log/sendmail.st 664 10 * 168 B > /usr/home/sites/logsite01txt 664 9 * 1503 B > > since I wanted that the file rotated at the 15:03 hours. > > On the contrab file I have this: > > # > #minute hour mday month wday who command > 04 15 * * * root newsyslog > 05 15 * * * root killall -HUP httpd > > But it is not working. I checked the permission and that's not the problem. Its working. Its just not doing what you said you want. Its not going to rotate until the log file is 1503 hours old. Try replacing the size field with a "1" (for 1024 bytes) and replace 1503 in the age/time column with *. As for your killall -HUP, IMHO this can be handled better within newsyslog. Just put "/var/run/http.pid" in the next column. Thing to be careful of is that Apache may still have the log file open when newsyslog renames it. This is OK as long as you don't try to gzip the old file within newsyslog. http://www.freebsddiary.org/rotatelogs.html#nocompress -- David Kelly N4HHE, dkelly@hiwaay.net ===================================================================== The human mind ordinarily operates at only ten percent of its capacity -- the rest is overhead for the operating system. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message