Re: logrotate compress issue

Ajeesh Kannan <[email protected]>
Newsgroups gmane.org.user-groups.linux.ilugc
Message-ID <CA+ark-owRwHrFvpeJmK9XHdKVwK7zQ2O3m1Dz0M54TE+BF_tSw@mail.gmail.com>
On Wed, Nov 11, 2015 at 12:47 PM, Arun Khan <[email protected]> wrote:

> On Wed, Nov 11, 2015 at 1:33 AM, Ajeesh Kannan <[email protected]>
> wrote:
> > H,
> >
> > i have added  logrotate as follows,
> >
> > log.* {
> >         daily
> >         missingok
> >         rotate 2
> >         dateext
> >         dateformat %Y-%m-%d.
> >         compress
> >         maxage 40
> > }
> >
> > But now the zipped logs are again and again zipping.
> >
> > .gz-20151011.gz2015-11-10..gz
> >
> > Can you check anything wrong in my logrotating
>
> I don't think the above will work.  "log.*" wildcard matches the
> compressed files also.  So change the regex or specify the log file's
> complete name.
>
> Also, logrotate would need some finite amount of time to rename the
> current log file and replace it with a 0 length logfile for the daemon
> to log.
>
> If your daemon supports a SIGHUP, then it might be worhtwile to do a
> postrotate SIGHUP so that the daemon starts logging on the new file.
> Also, try delaycompress in conjuction with compress.  For more
> details,  RTFM   "man logrotate."
>
> You may have to experiment with the logrotate options to get what you want.
>
> Just a thought, if your distro is a RHEL/derivative check for SELinux
> gotchas.
>
> It would be great if you could share your solution.
>
> HTH,
> -- Arun Khan
> _______________________________________________
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
> ILUGC Mailing List Guidelines:
> http://ilugc.in/mailinglist-guidelines
>


Thank you for your update.

I am keeping 90 logs like :
message.log.1
message.log.2
message.log.3
.
.
message.log.90

and I need to keep two archive files for every log for 40 days files. But
now the logrotate
log.* {

option is taking "message.log.3.gz" files also in the next logrotate cycle.

I need to exclude the .gz files rotation.

-- 
With Regards,
Ajeesh B.Kannan
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.