From owner-freebsd-stable Wed Aug 1 13:24:36 2001 Delivered-To: freebsd-stable@freebsd.org Received: from terminus.rootprompt.net (ci933622-a.ruthfd1.tn.home.com [24.252.218.138]) by hub.freebsd.org (Postfix) with ESMTP id 9177437B401 for ; Wed, 1 Aug 2001 13:24:32 -0700 (PDT) (envelope-from robert@rootprompt.net) Received: from recon (recon.rootprompt.net [192.168.1.2]) by terminus.rootprompt.net (Postfix) with SMTP id 957E3F805; Wed, 1 Aug 2001 15:24:30 -0500 (CDT) From: "Robert Banniza" To: "Roelof Osinga" , "Evan Oldford" Cc: "Kashyap Kumar" , Subject: RE: Apache Log question! Date: Wed, 1 Aug 2001 15:26:39 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <3B686488.6FF5FCFE@eboa.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I use the following script within cron to get it done: ##################### BEGIN SCRIPT ######################## #!/bin/sh # rotates webserver log files DATE=`/bin/date +%m%d%Y_%H%M%S` BASE_DIR='/var/log' LOGS='httpd-access.log httpd-error.log' for i in $LOGS; do if [ -f $BASE_DIR/$i ]; then /bin/cp $BASE_DIR/$i $BASE_DIR/$i.$DATE > $BASE_DIR/$i /usr/bin/gzip $BASE_DIR/$i.$DATE fi # search and delete older logs /usr/bin/find $BASE_DIR -name $i.* -a -mtime +30 -exec rm {} \; done ##################### END SCRIPT ######################## Robert -----Original Message----- From: owner-freebsd-stable@FreeBSD.ORG [mailto:owner-freebsd-stable@FreeBSD.ORG]On Behalf Of Roelof Osinga Sent: Wednesday, August 01, 2001 3:20 PM To: Evan Oldford Cc: Kashyap Kumar; freebsd-stable@FreeBSD.ORG Subject: Re: Apache Log question! Evan Oldford wrote: > > Kashyap Kumar wrote: > > > > Hi, > > > > Can anybody help me to rotate my apache logs in /var/log directory. How can > > I do that with syslog? > > > > help very much appriciated > > > > /mn > > http://www.freebsddiary.org/rotatelogs.php has a great example... Take a look at .../ports/sysutils/cronolog, does a nice job although it keeps a lot of processes around. Roelof -- _______________________________________________________________________ eBOAź est. 1982 http://eBOA.com/ tel. +31-58-2123014 mailto:info@eBOA.com?subject=Information_request fax. +31-58-2160293 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message