1

I wish to rotate logs by file size and retain old logs by age. The maxage parameter puts a check on how old rotated files could be. But I am looking for a case where you rotate files when they reach a specific size (say 100k) and keep as many old files for a specific number of days (say 7 days).

It could be possible that there are lesser number of writes to the log file and there could be only one rotation in 7 days, or you could have multiple rotation within a single day. In any case I want to keep old files for 7 days (in this case) from the day they are created

sibiyes
  • 61
  • 7
  • Logrotate has a `size` option (i.e. `size 100k`). And by looking at the logrotate manpage, the `maxage count` option removes rotated logs older than x days, but it's only checked **if** the logfile is to be rotated. So couldn't you combine the two to get your desired outcome? – drewyupdrew May 13 '16 at 15:19

0 Answers0