From owner-freebsd-questions Mon Mar 4 12:38:43 2002 Delivered-To: freebsd-questions@freebsd.org Received: from saigon.cpd.ufsm.br (saigon.cpd.ufsm.br [200.18.32.130]) by hub.freebsd.org (Postfix) with ESMTP id 79B5B37B400 for ; Mon, 4 Mar 2002 12:38:39 -0800 (PST) Received: from marcio by saigon.cpd.ufsm.br with local (Exim 3.16 #7) id 16hzE8-0004j4-00 for freebsd-questions@FreeBSD.ORG; Mon, 04 Mar 2002 17:38:32 -0300 Date: Mon, 4 Mar 2002 17:38:32 -0300 (GRNLNDST) From: Marcio d'Avila Scheibler To: freebsd-questions@FreeBSD.ORG Subject: Re: Re[2]: newsyslog/rotatelog In-Reply-To: <8834995732.20020304211718@Weenink.com> Message-ID: X-Mailer: Pine 4.05 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Hello alexus, > > What if you use some sort of monthly cron job that runs a shellscript > a little better than: > > apachectl stop > tar -zcvf /backup/accesslog`date`.tgz /path/to/httpd-access.log > cp dev/null /path/to/httpd-access.log > apachectl start > Have you tried logrotate package (sysutils section) ? You add logrotate command to your crontab, then in logrotate.conf you define a pre-rotate section with commands (apachectl stop) and a post-rotate section (apachectl start). It manages gzip and version numbers for you. log -> log.0 -> log.1.gz -> log.2.gz and so on... p.s. I lost the beginning of this thread. Sorry if logrotate package was already menshioned there... ------------------------------------------------------------------------------ Marcio d'Avila Scheibler - Divisao de Suporte (marcio@cpd.ufsm.br) Centro de Processamento de Dados - Campus Universitario - CEP 97105-900 Universidade Federal de Santa Maria - RS - Brasil ============================================================================= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message