From owner-freebsd-questions Mon Apr 20 16:09:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA20542 for freebsd-questions-outgoing; Mon, 20 Apr 1998 16:09:26 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from servidor.exsocom.com.mx (servidor.exsocom.com.mx [200.34.46.130]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA20508 for ; Mon, 20 Apr 1998 23:09:06 GMT (envelope-from agalindo@servidor.exsocom.com.mx) Received: from servidor.exsocom.com.mx.exsocom.com.mx (direccion.exsocom.com.mx [200.34.46.131]) by servidor.exsocom.com.mx (8.8.7/8.8.5) with SMTP id SAA01652; Mon, 20 Apr 1998 18:14:50 -0500 (CDT) Message-Id: <1.5.4.32.19980421001346.006ad580@exsocom.com.mx> X-Sender: agalindo@exsocom.com.mx X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 20 Apr 1998 18:13:46 -0600 To: David Kelly From: Alejandro Galindo Subject: Re: newsyslog process Cc: freebsd-questions@FreeBSD.ORG Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG yes, you are right. I use a number becouse i develope a program for control the user login time, from the web i indicate a period (first date - last date) and i can see all the access for the user, and for me its more easy to have the number (if i use the date i will need to change the other program). The only important thing is the compatibility with 2.2.6, now i have 2.2.5, and may be i need to change the rotate from weekly to monthly. Thanks for all David Saludos Alejandro >I just grabbed what I had laying around. By placing the date in the new >file name you can easily know when it was rotated out, and be reasonably >assured there are no other files with the same name. > >0 0 * * 6 root umask 2; if test -f /var/log/wtmp.next; then X=`cat \ >/var/log/wtmp.next`; else X=0; echo 0 > /var/log/wtmp.next; fi; expr \ >`cat /var/log/wtmp.next` + 1 > /var/log/wmtp.next; mv /var/log/wtmp \ >/var/log/wtmp.$X; touch /var/log/wtmp; chown root.bin /var/log/wtmp;\ >gzip /var/log/wtmp.$X > >Think you are right to move this out of your crontab into a separate >file. I'm getting silly seeing how much I can stuff into it. Would be >best if you tested for the existence of wtmp.$X before moving a file on >top of it (exercise left for the reader). > >But best of all, 2.2.6-RELEASE or 2.2.6-STABLE has moved this out of >newsyslog into /etc/monthly. Wtmp's moved there are tagged with the >month name. Then login accounting is performed. By rotating your wtmp >every week you stand to scramble the value of a monthly login accounting >report. Maybe you should simply fix the filename for the monthly rotated >wtmp and run /etc/monthly every week? Or move wtmp and login accounting >into /etc/weekly. > > >-- >David Kelly N4HHE, dkelly@nospam.hiwaay.net >===================================================================== >The human mind ordinarily operates at only ten percent of its >capacity -- the rest is overhead for the operating system. > > > > ---------------------------------------------------------------------------- | , , | | /( )` | | \ \___ / | | | /- _ `-/ ' | | (/\/ \ \ /\ | | ExSoCom Dgo. MEXICO / / | ` \ | | O O ) / | | | `-^--'`< ' | | (_.) _ ) / | | Alejandro Galindo Chairez `.___/` / | | Tel: (52 18) 179177 `-----' / | | Fax: (52 18) 179177 <----. __ / __ \ | | <----|====O)))==) \) /==== | | e-mail agalindo@exsocom.com.mx <----' `--' `.__,' \ | | | | | | http://www.exsocom.com.mx \ / /\| | ______( (_ / \______/ | | ,' ,-----' | | | a FreeBSD user `--{__________) | ---------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message