Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top