When using logrotate from a cronjob, I am getting this erros:

error: unable to open /var/log/mylog.1  for compression

Does any one know what does it mean and how can I fix it ?

link|improve this question
feedback

migrated from stackoverflow.com Nov 10 '11 at 10:38

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 2 down vote accepted

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*.

link|improve this answer
feedback

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'.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown