Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

logrotate configuration file:

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



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

share|improve this answer
Unfortunately I have to use the debian stable version, so dateext is supported, but dateformat isn't... is there any workaround for this problem? – viraptor Sep 30 '10 at 14:43
Just what I needed! – Joseph Lust Jul 10 '12 at 3:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.