2

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.

voretaq7
  • 79,879
  • 17
  • 130
  • 214
viraptor
  • 1,296
  • 6
  • 21
  • 41

1 Answers1

10

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.

bindbn
  • 5,211
  • 2
  • 26
  • 24