Logrotate Error: Unable to open ... for compression

It means that /var/log/mylog.1 does not exist or the permissions/ownership do not allow that file to be compressed. Check the permissions/ownership with ls -l /var/log/mylog*.


You're going to need to get more information.

Does the file exist, and does the user running cron have permission to read it?:

ls -l /var/log/mylog.1

See if logrotate can give more information. It should have a verbose flag you can turn on with '-v'.


If the file exists, and the permissions are ok, then a cause can be that the file is open when you try to compress it. In order to avoid that, you can add the following line to your /etc/logrotate.conf:

delaycompress