From: Frank Brehm Date: Tue, 19 Nov 2019 05:38:27 +0000 (+0100) Subject: daily autocommit X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=1b268e19ffab070de2ba9551e8af0ea508d292ae;p=config%2Fns2%2Fetc.git daily autocommit --- diff --git a/cron.daily/logrotate b/cron.daily/logrotate index 189da6a..2166db5 100755 --- a/cron.daily/logrotate +++ b/cron.daily/logrotate @@ -1,6 +1,15 @@ #!/bin/bash -test -x /usr/sbin/logrotate || exit 0 +# skip in favour of systemd timer +if [[ -d /run/systemd/system ]]; then + exit 0 +fi + +# this cronjob persists removals (but not purges) +if [[ ! -x /usr/sbin/logrotate ]]; then + exit 0 +fi + LOG=/var/log/logrotate.log echo >> ${LOG} echo "################################################" >> ${LOG} diff --git a/logrotate.conf b/logrotate.conf index 9387043..9634d7b 100644 --- a/logrotate.conf +++ b/logrotate.conf @@ -5,9 +5,15 @@ weekly # keep 4 weeks worth of backlogs rotate 99 +missingok +notifempty + # create new (empty) log files after rotating old ones create +dateext +dateformat -%Y-%m-%d + # uncomment this if you want your log files compressed compress delaycompress diff --git a/logrotate.d/certbot b/logrotate.d/certbot index 05caa95..ccd55c3 100644 --- a/logrotate.d/certbot +++ b/logrotate.d/certbot @@ -2,5 +2,7 @@ rotate 12 weekly compress + delaycompress + minsize 1M missingok -} \ No newline at end of file +} diff --git a/logrotate.d/fail2ban b/logrotate.d/fail2ban index ea46428..9556daf 100644 --- a/logrotate.d/fail2ban +++ b/logrotate.d/fail2ban @@ -3,6 +3,7 @@ weekly rotate 4 compress + minsize 4M delaycompress missingok