Using logrotate to ONLY delete logs that are managed/rotated by another service

logrotate

There are many programs out there that manage log file rotation by themselves. Many of them however only rotate the log and never delete them, and assume that is just part of the sysadmin's job and he/she will backup or delete as necessary.

My question is can I use Logrotate to only delete old logfiles? Something like

/some/log/path/*{
maxage 90
}

I realize this can be easily accomplished with Cron and other ways, but my question is specifically using Logrotate. Are there any downsides to doing this?

Thanks!

Best Answer

The manpage says:

maxage count

Remove rotated logs older than <count> days. The age is only checked if the logfile is to be rotated. The files are mailed to the configured address if maillast and mail are configured.

(Emphasis added.) Going by this, unless logrotate is responsible for rotating the log, then maxage will be ignored.

I thought about maybe configuring logrotate to perform rotate operation that effectively does nothing but I'm not seeing anything among the configuration options that would easily allow that.