I am using latest version of CentOS with NGINX.
My Logrotate.conf file has two blocks/directives for fail2ban log (maybe it was a mistake by my previous hosting provider). Therefore, I am receiving an error of duplicate entry for /var/log/fail2ban.log
The first one is:
/var/log/fail2ban.log {
missingok
notifempty
size 30k
create 0600 root root
postrotate
/usr/bin/fail2ban-client set logtarget SYSLOG 2> /dev/null || true
endscript
}
The second one is:
/var/log/fail2ban.log {
missingok
notifempty
postrotate
/usr/bin/fail2ban-client flushlogs >/dev/null || true
endscript
}
I understand that I have to remove one. But, first I want to know what does flushlogs
and set logtarget SYSLOG 2
mean? Which block should I delete?
I really searched a lot on the web but there is not enough resources available about the configurations of Logrotate.
Thank you for your help!