On one of the servers I manage I was troubleshooting a problem where logrotate (check out our guide for setting up logrotate on a custom file) wasn’t running on a set of files. To troubleshoot problems with logrotate I always run the command with a specific configuration and the force (-f) and verbose (-v) options:
I assumed it was having trouble with the file it was trying to rotate so I messed with those permissions for a while but then I looked at the permissions on the configuration file:
Logrotate doesn’t like the fact that other people can write to the file so I changed the permissions so only root had write access:
Then everything worked.
Like this post? Don't forget to follow us on Twitter and Facebook for updates.