* trimming wtmp
@ 2003-01-13 20:06 Daniel Berger
2003-01-14 0:12 ` Paul Szabo
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Berger @ 2003-01-13 20:06 UTC (permalink / raw)
Hey all -
Is there a way to trim wtmp? Mine goes back years and has gotten huge.
I'd like to keep the last year or so's worth of logins.
thanks
dhb
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: trimming wtmp
2003-01-13 20:06 trimming wtmp Daniel Berger
@ 2003-01-14 0:12 ` Paul Szabo
2003-01-15 4:28 ` Nico Kadel-Garcia
0 siblings, 1 reply; 5+ messages in thread
From: Paul Szabo @ 2003-01-14 0:12 UTC (permalink / raw)
To: Daniel Berger
Daniel Berger wrote:
> Is there a way to trim wtmp? Mine goes back years and has gotten huge.
What we do, yearly, is (at a quiet time):
cp -ip /usr/adm/wtmp /usr/adm/wtmp.2002
echo -n '' > /usr/adm/wtmp
so the system has a nice, small (empty) file to fill up again.
--
Paul Szabo - psz@maths.usyd.edu.au http://www.maths.usyd.edu.au:8000/u/psz/
School of Mathematics and Statistics University of Sydney 2006 Australia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: trimming wtmp
2003-01-14 0:12 ` Paul Szabo
@ 2003-01-15 4:28 ` Nico Kadel-Garcia
2003-01-15 4:42 ` Stuart Fuller
0 siblings, 1 reply; 5+ messages in thread
From: Nico Kadel-Garcia @ 2003-01-15 4:28 UTC (permalink / raw)
"Paul Szabo" <psz@maths.usyd.edu.au> wrote in message
news:3E2355D6.794B@maths.usyd.edu.au...
> Daniel Berger wrote:
> > Is there a way to trim wtmp? Mine goes back years and has gotten huge.
>
> What we do, yearly, is (at a quiet time):
>
> cp -ip /usr/adm/wtmp /usr/adm/wtmp.2002
> echo -n '' > /usr/adm/wtmp
>
> so the system has a nice, small (empty) file to fill up again.
Log rotation is an art form. Take a look at this approach:
mv /usr/adm/wtmp /usr/adm/wtmp.{backup name}
kill -HUP {syslog process ID}
This way, you restart the syslog daemon correctly and the data continues to
pour into the file descriptor of the original file even in its new location
until you restart it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: trimming wtmp
2003-01-15 4:28 ` Nico Kadel-Garcia
@ 2003-01-15 4:42 ` Stuart Fuller
2003-01-15 14:36 ` Nico Kadel-Garcia
0 siblings, 1 reply; 5+ messages in thread
From: Stuart Fuller @ 2003-01-15 4:42 UTC (permalink / raw)
Nico Kadel-Garcia wrote:
>
> "Paul Szabo" <psz@maths.usyd.edu.au> wrote in message
> news:3E2355D6.794B@maths.usyd.edu.au...
>> Daniel Berger wrote:
>> > Is there a way to trim wtmp? Mine goes back years and has gotten huge.
>>
>> What we do, yearly, is (at a quiet time):
>>
>> cp -ip /usr/adm/wtmp /usr/adm/wtmp.2002
>> echo -n '' > /usr/adm/wtmp
>>
>> so the system has a nice, small (empty) file to fill up again.
>
> Log rotation is an art form. Take a look at this approach:
>
> mv /usr/adm/wtmp /usr/adm/wtmp.{backup name}
> kill -HUP {syslog process ID}
>
> This way, you restart the syslog daemon correctly and the data continues
> to pour into the file descriptor of the original file even in its new
> location until you restart it.
Umm, does syslog write to /usr/adm/wtmp? I don't think it does, so I don't
understand the purpose of restarting syslog
--
Stu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: trimming wtmp
2003-01-15 4:42 ` Stuart Fuller
@ 2003-01-15 14:36 ` Nico Kadel-Garcia
0 siblings, 0 replies; 5+ messages in thread
From: Nico Kadel-Garcia @ 2003-01-15 14:36 UTC (permalink / raw)
"Stuart Fuller" <stufuller@usa.net> wrote in message
news:hso20b.t55.ln@dadsys2.fuller.local...
> Nico Kadel-Garcia wrote:
>
> >
> > "Paul Szabo" <psz@maths.usyd.edu.au> wrote in message
> > news:3E2355D6.794B@maths.usyd.edu.au...
> >> Daniel Berger wrote:
> >> > Is there a way to trim wtmp? Mine goes back years and has gotten
huge.
> >>
> >> What we do, yearly, is (at a quiet time):
> >>
> >> cp -ip /usr/adm/wtmp /usr/adm/wtmp.2002
> >> echo -n '' > /usr/adm/wtmp
> >>
> >> so the system has a nice, small (empty) file to fill up again.
> >
> > Log rotation is an art form. Take a look at this approach:
> >
> > mv /usr/adm/wtmp /usr/adm/wtmp.{backup name}
> > kill -HUP {syslog process ID}
> >
> > This way, you restart the syslog daemon correctly and the data continues
> > to pour into the file descriptor of the original file even in its new
> > location until you restart it.
>
> Umm, does syslog write to /usr/adm/wtmp? I don't think it does, so I
don't
> understand the purpose of restarting syslog
??? Damn, you're right. Still, moving aside is better.
There's a *reason* log rotation is an art form, each one is slightly
different.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-01-15 14:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-13 20:06 trimming wtmp Daniel Berger
2003-01-14 0:12 ` Paul Szabo
2003-01-15 4:28 ` Nico Kadel-Garcia
2003-01-15 4:42 ` Stuart Fuller
2003-01-15 14:36 ` Nico Kadel-Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox