Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unlimited logs with logrotate

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.

like image 316
stewbert Avatar asked Oct 05 '22 22:10

stewbert


1 Answers

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.

like image 67
fedorqui 'SO stop harming' Avatar answered Oct 13 '22 10:10

fedorqui 'SO stop harming'