I'm running a CentOS 6.9 VPS with cpanel/whm. Currently, my apache2 domlogs rotate daily. I need to run scripts that parse a domain log before it rotates.
I tried adding:
prerotate
/usr/local/bin/dstats > /dev/null 2>/dev/null || true
/usr/local/bin/dreport > /dev/null 2>/dev/null || true
endscript
to logrotate.d/httpd, but the scripts didn't appear to run. Investigating further, I see that logrotate.conf is set to rotate logs weekly.
What do I need to do to run these scripts before the domlog rotates?
I tried adding:
prerotate
/usr/local/bin/dstats > /dev/null 2>/dev/null || true
/usr/local/bin/dreport > /dev/null 2>/dev/null || true
endscript
to logrotate.d/httpd, but the scripts didn't appear to run. Investigating further, I see that logrotate.conf is set to rotate logs weekly.
What do I need to do to run these scripts before the domlog rotates?