I've been dealing with log rotation on my servers, and it's just not happening. I've checked the cron jobs, everything looks fine, permissions seem okay, and there are no errors in the logs. I've tried tweaking the configurations and have even restarted a few times. I can manually rotate the logs, but that feels unnecessary. Should I write a simple nightly script to handle this, or is there a setting I'm overlooking? I'm mostly working with nginx logs alongside a couple of application logs on Ubuntu, and they're piling up to around 40-50 gigs. Does anyone have a reliable method for log rotation that doesn't take all my time?
3 Answers
I’m using the default logrotate setup for nginx on Ubuntu 24.04. When I did the verbose check with `logrotate -d /etc/logrotate.conf`, it said it *would* rotate everything, but nothing actually happens when the schedule runs. Any suggestions?
Are you using logrotate for this? If so, running `logrotate --debug` might give us more insight into what's going wrong. It should show whether logrotate thinks it will rotate the logs or if there are any issues you're missing.
Definitely don’t write a script for log rotation. Instead, let's make sure you're using the right settings. Which version are you using? Also, can you post the logrotate configuration you're working with? It sounds like it's not processing the logs as expected, so we need to dive into those details to help you out.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures