Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

share|improve this question

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

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

add comment

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.