From 67a94733a9b3eec7e325dcdbbf411473770d36bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Sep 2015 11:01:22 +0300 Subject: [PATCH] logrotate: Do not rotate empty logs As a useful side effect, prevents "Unable to contact server. Is it running?" mails from cron when fail2ban hasn't been (intentionally) running nor thus logging anything either. --- ChangeLog | 1 + files/fail2ban-logrotate | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2fec408a..811473e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ ver. 0.9.4 (2015/XX/XXX) - wanna-be-released - New Features: - Enhancements: + * Do not rotate empty log files ver. 0.9.3 (2015/08/01) - lets-all-stay-friends ---------- diff --git a/files/fail2ban-logrotate b/files/fail2ban-logrotate index ef4da852..8d94a8b3 100644 --- a/files/fail2ban-logrotate +++ b/files/fail2ban-logrotate @@ -8,6 +8,7 @@ /var/log/fail2ban.log { rotate 7 missingok + notifempty compress postrotate /usr/bin/fail2ban-client flushlogs 1>/dev/null || true