From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [lame logrotate Q]
Date: Mon, 21 Dec 2009 08:42:43 +0200 [thread overview]
Message-ID: <200912210842.43174.alan.mckinnon@gmail.com> (raw)
In-Reply-To: <4B2EF117.7020403@gmail.com>
On Monday 21 December 2009 05:52:55 Dale wrote:
> Harry Putnam wrote:
> > Can anyone show me how to write a logrotate rule that will rotate on
> > either size or age?
> >
> > I use some very simple scripting for yrs but don't really see how to
> > rotate on more than one condition.
> >
> > I'd like to rotate a certain log weekly or over 7000k and keep no more
> > than 12 rotations for whatever reason.
> >
> > /var/log/debug.log {
> > create 0600 reader wheel
> > weekly || size=7000k
> > rotate 12
> > postrotate
> > /etc/init.d/rsyslog reload > /dev/null 2>&1 || true
> > endscript
> > }
> >
> > Is clearly NOT the right way to go.
> >
> > Any know how to do it?
>
> man logrotate has a few examples that may help. Here is one.
>
> "/var/log/httpd/access.log" /var/log/httpd/error.log {
> rotate 5
> mail www@my.org
> size 100k
> sharedscripts
> postrotate
> /usr/bin/killall -HUP httpd
> endscript
> }
>
>
> I notice that the size part is on its own line which may be the issue.
That will rotate his log when it gets to 100k, and only when it gets to 100k.
The OP wants to rotate when either the log file is a certain size, or every
week, whichever comes first.
Logrotate does not support that feature.
--
alan dot mckinnon at gmail dot com
next prev parent reply other threads:[~2009-12-21 8:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-21 0:06 [gentoo-user] [lame logrotate Q] Harry Putnam
2009-12-21 3:52 ` Dale
2009-12-21 6:42 ` Alan McKinnon [this message]
2009-12-21 16:14 ` [gentoo-user] " reader
2009-12-26 19:21 ` Mick
2009-12-21 16:48 ` [gentoo-user] Problem with old nvidia-drivers-71.86.11 (depending x11-base/xorg-server vanished form portage-tree) Christian Könitzer
2009-12-21 21:38 ` [gentoo-user] " walt
2009-12-22 9:56 ` Christian Könitzer
2009-12-21 21:40 ` [gentoo-user] " Alan McKinnon
2009-12-21 22:24 ` Dale
2009-12-22 9:55 ` Christian Könitzer
2009-12-21 22:14 ` [gentoo-user] [lame logrotate Q] Neil Bothwick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912210842.43174.alan.mckinnon@gmail.com \
--to=alan.mckinnon@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox