Why isn’t my log rotation working?

0
8
Asked By TechyNerd42 On

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

Answered By TechyNerd42 On

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?

Answered By ServerGuru99 On

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.

Answered By LogMaster3000 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.