I am trying to enable log rotation for WordPress log files. I need to enable log rotation and after 30 days it needs to be compressed and archived after 60 it needs to be deleted.
I created a file app.conf in /etc/logrotate.d folder with the below content:
/var/www/firebolt-app/wp-content/*.log {
weekly
rotate 4
maxage 90
}
Then I ran logrorate -d app.conf
and it doesn't appear in logrotate status as well as no change in the debug file.
Is there anything like - rotation only will happen in files inside /var/log?
I know this is a bit of necromancy, but for the hundreds that bump on this, I did a working log rotation scheme on worpress -ubuntu 22-
And include there the logrotate commands, I used those:
Tested with:
Works OK:
logrotate on ubuntu is controlled by cron.daily which is launched at 6.25 UTC by the main crontab