Question

My rsyslog logrotate config file is -

/home/user/logs/*.l {

   daily
   postrotate
     reload rsyslog >/dev/null 2>&1 || true
   endscript


}

The file is rotating properly but the logs are going into the old log file. The issue gets resolved when I manually restart rsyslog.

I'm running this on CentOS.

Was it helpful?

Solution 2

In the end it was resolved with compress daily instead of rotate. For some reason, it wasn't working on CentOS6.4

OTHER TIPS

reload syslog didn't work for me, either. I used service rsyslog restart instead.

restart service is not recommended for it could lose log. I resolve this problem with: 1. killall -HUP rsyslogd 2. kill -HUP $(cat /var/run/rsyslogd.pid)

the pid filename may be syslogd.pid. HUP lets rsyslogd perform close all open files according to man page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top