[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: logcheck oddity -- actually logrotate oddity!



On 2 Mar 2003 at 11:27, Martin Kacerovsky wrote:

> > I wanted to rotate that file using logcheck and created a file 
> 
> I think you mean logrotate and not logcheck, logcheck is a tool used
> to periodic checking of log files and generating e-mail messages about
> unusual events or possible security violations.
Oh dear, mea culpa, brown paper bag on head -- I did, of course, mean 
logrotate and had just been adding a few lines to logcheck.ignore 
coincidentally and am clearly demeting.
 
> > /etc/logrotate.d/chrismail:
> > 
> > 
> > "/var/log/mailcopy/chris.mail" {
> >         rotate 7
> >         daily
> >         create
> >         missingok
> > }
> 
> That should work fine.
I thought so too!
 
> > That didn't do anything so logged in as root I tried logrotate -d
> > chrismail which said the file didn't need rotating.  So I tried
> > logrotate -d -f chrismail which said it did everything, all the file
> > copying etc. and the creation of the new file ... but it didn't. 
> > I've tried that several times with same result.
> 
> What do you mean, it didn't anything, how many days? 
I've only tried it today but it said it had copied chris.mail to 
chris.mail.1 and created new log file ... and it simply hadn't, not 
at all, no way, nothing changed, nada ... despite running that 
several times with same message sequence to console
 
> > savelog, interestingly, seems to work fine.  /var/log/mailcopy is
> > world readable and executable and owned and grouped to root. 
> > /var/log/mailcopy/chris.mail is owned and grouped to postfixe (my
> > user for postfix) and owner and group rw and world r permitted.
> 
> savelog works everytimes you run it, that means rotates, compresses,
> but logrotate checks the date ... My experience with it is that after
> first day it does nothing, second day it creates <logfile>.0 and third
> day begins to compress. As far as I remember...
Aha -- that would explain it.  Odd that it gives those console 
messages though.  Now I've used savelog things may be different but I 
was only using savelog as a one off from the console so I'll see what 
happens when logrotate runs from cron tomorrow.  Thanks.

Thanks.  Look for more postings in a day or so if it doesn't improve 
... or to clarify things if it does!

C
PSYCTC: Psychotherapy, Psychology, Psychiatry, Counselling
   and Therapeutic Communities; practice, research, 
   teaching and consultancy.
Chris Evans & Jo-anne Carlyle
http://psyctc.org/ Email: chris@psyctc.org





Reply to: