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 have the following parameters set up for the log rotation of a log. size=10M, rotate 800, copytruncate, missingok. 800 rotated files are being created, but many of them are below 10M and some of them are empty with 0 size.

I have a cron setup as * * * * * which runs every minute to do this logrotation. I don't want this, can't understand why it is happening.

share|improve this question
add comment

1 Answer

Try this option:

notifempty
    Do not rotate the log if it is empty (this overrides the ifempty option).

Source: http://linux.die.net/man/8/logrotate

share|improve this answer
    
I tried that too. But still the sizes of the rotated logs are different from one another, instead of all having 10M size, Infact, some are more than 10M. –  NixMan Jan 21 '13 at 6:19
    
@NixMan: They won't have exactly the same size. Just look at the manual: "Log files are rotated when they grow bigger than size bytes. [...]" –  0xFF Jan 25 '13 at 9:44
add comment

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.