Logrotate setup

Support Ticket

+status
acknowledged
+tags
 

So production.log is 4G....

If I'm going to setup logrotate, do I have to have wagn restart postrotate?

 

I'm just looking at the config file in /etc/logrotate.d for apache2. Everything else in there seems like it would be fine, but the postrotate and prerotate things seem apache-specific, and if I need to tell wagn to reload, well, I don't know how to do that.

 

Can I just drop those parts and be ok?

/srv/www.teenwolfwiki.com/log/*.log {

        weekly

        missingok

        rotate 52

        compress

        delaycompress

        notifempty

        create 640 root adm

        sharedscripts

        postrotate

                /etc/init.d/apache2 reload > /dev/null

        endscript

        prerotate

                if [ -d /etc/logrotate.d/httpd-prerotate ]; then \

                        run-parts /etc/logrotate.d/httpd-prerotate; \

                fi; \

        endscript

}

 

I don't know anything about logrotate. A quick glance made it look like it's run as a cron job, though, so my guess is you don't have to do anything.

--Ethan McCutchen.....2014-12-02 22:24:48 +0000

Well, I guess the question is this: is wagn going to throw a fit if production.log suddenly changes while it's running?

--Lora Friedenthal.....2014-12-02 23:11:29 +0000

FWIW

 

/srv/www.teenwolfwiki.com/log/*.log {

weekly

missingok

rotate 52

compress

delaycompress

notifempty

sharedscripts

postrotate

/etc/init.d/apache2 reload > /dev/null

endscript

prerotate

if [ -d /etc/logrotate.d/httpd-prerotate ]; then \

run-parts /etc/logrotate.d/httpd-prerotate; \

fi; \

endscript

}

 

seems to work quite nicely. My 4G log file is now a 340MB log file and it's already done a second rotation. I don't actually know if the reloading apache part is necessary, but it doesn't seem to be hurting anything.

--Lora Friedenthal.....2014-12-14 14:00:32 +0000