Specific names after logrotate

logrotate

I'd like logrotate to create files which have nice names. Is there some way to force some pattern for the names after rotation? I'd like to create a service-{year}-{month}-{day}-{hour} format and rotate hourly.

It seems I'm running a version with dateext, but without dateformat. I'd like to use this logging way anyways.

Best Answer

logrotate configuration file:

dateext
dateformat -%Y-%m-%d-%s

Out:

atop.log-2010-09-30-1285850549

hour is not supported. You can use the postrotate to rename.