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 ?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
I just hit this error myself. Summary: it was a conflict between
logrotate and a postrotate script I'd written, where in certain circumstances my
logrotate script would delete the just-moved log file before it was compressed. Although you'd think that
logrotate would compress the file and then run the post-rotate script, it actually does it in the other order. Hence this error message.
logrotate directly manages the file that the question shows as missing, I can't think of anything else that might cause this problem, unless there's something really strange about the file permissions (e.g. writeable and not readable).