문제

In a normal logrotate.d configuration file, is there any way to set an unlimited amount of potential logs?

The only thing I can seem to come up with is setting it at some crazy number that will never be met. Something like:

/var/log/app/* {
  missingok
  weekly
  copytruncate
  rotate 10000000000
  compress
  notifempty
  olddir /var/log/app/old
}

But that seems pretty hacky to me.

도움이 되었습니까?

해결책

From UNIX logrotate man page:

rotate count

Log files are rotated times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather then rotated.

So I guess you need to write a huge number to work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top