Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.

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

 
discard

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.