Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.