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 w...@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.

Dale

:-) :-)

Reply via email to