0

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 flushlogsand 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!

1 Answer 1

0

The set logtarget SYSLOG was the method of log rotation before flush logs was implemented and available in fail2ban v0.8.12.

So delete the first one (assuming centos has a fail2ban >= 0.8.12).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .