Search This Blog

Friday, July 8, 2016

Logrotate HAproxy every 6 hours

Running the logrotate with -f in a cron job:

cat /etc/cron.d/haproxy_logrotate_6h
30 */6 * * * root logrotate -f /etc/logrotate.d/haproxy


My /etc/logrotate.d/haproxy


/var/log/haproxy.log {
daily
rotate 52
missingok
notifempty
compress
delaycompress
postrotate
invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
endscript
}

No comments:

Post a Comment