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

Using the following logrotate config file, rotated files are being chowned to the specified user but not compressed ones.

    /var/log/file.log {
            size 1M
            rotate 30
            create 0600 user group

Is this an expected behaviour from logrotate and if yes how can I tweak it to compress the logs with the correct permissions and user:group ?

share|improve this question
up vote 1 down vote accepted

'create' option tell logrotate to create new log file with specified permission before running postrotete script. It does not affect on permissions of compressed files. You may try this:

chown user:group /var/log/yourapp/*.gz
chmod -R 0600 /var/log/yourapp/*.gz
share|improve this answer
So this is expected behaviour, I was hoping to not use custom scripts/commands inside logrotate configs. – pl1nk Mar 21 '13 at 16:02

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.