From owner-freebsd-questions Wed May 1 21:46:47 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA12931 for questions-outgoing; Wed, 1 May 1996 21:46:47 -0700 (PDT) Received: from statsci.statsci.com (statsci.statsci.com [198.145.127.9]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA12926 for ; Wed, 1 May 1996 21:46:44 -0700 (PDT) Received: by statsci.statsci.com (Smail3.1.28.1 #3) id m0uEq8y-0005iQC; Wed, 1 May 96 21:37 PDT Received: from localhost (localhost [127.0.0.1]) by one.sabami.seaslug.org (8.6.12/8.6.12) with SMTP id VAA00231; Wed, 1 May 1996 21:39:29 -0700 Message-Id: <199605020439.VAA00231@one.sabami.seaslug.org> To: Terry Lambert cc: root@fledge.watson.org (System Administrator), questions@freebsd.org Subject: Re: /etc/monthly, /etc/daily -- log rotation In-reply-to: Your message of "Wed, 01 May 1996 12:10:21 -0700." <199605011910.MAA09979@phaeton.artisoft.com> Reply-to: scott@statsci.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <228.831011969.1@one.sabami.seaslug.org> Date: Wed, 01 May 1996 21:39:29 -0700 From: Scott Blachowicz Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Terry Lambert wrote: > Too bad you posted their code and we are all contaminated. 8-(. Should that be taken as an invitation for everyone to post their favorite log rotating scripts? Mine's called logrot: #! /bin/sh # usage=" usage: logrot [-Z | -gz] [-p COMPRESS_PROG] [-O COMPRESS_OPTS] [-nz] [-n NUM2KEEP] file ... This script rotates the named files through a set of NUM2KEEP previous versions of the files. Each backup is named by appending ".n" to the filename where ".1" is the most recent backup file, ".2" is the 2nd most recent backup file, etc. Each of the backup files is optionally compressed. option -Z == '-p compress' option -gz == '-p gzip' option -nz == No Zero (don't zero-out the current file. Useful when what you want is to maintain several versions of the same file instead of rotate/truncating growing log files) default COMPRESS_PROG = ':' # That is, no compression by default. default COMPRESS_OPTS = '' # Options passed thru to compression prog. default NUM2KEEP = 3 # Num of backup files to keep. " If you want the rest I can provide it, along with assurances that it's my own original creation, free for the taking. :-) Scott Blachowicz scott@statsci.com / scott@sabami.seaslug.org