Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 1998 18:13:46 -0600
From:      Alejandro Galindo <agalindo@servidor.exsocom.com.mx>
To:        David Kelly <dkelly@hiwaay.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: newsyslog process 
Message-ID:  <1.5.4.32.19980421001346.006ad580@exsocom.com.mx>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1.5.4.32.19980421001346.006ad580>