From: Frank Brehm Date: Tue, 19 Nov 2019 05:26:43 +0000 (+0100) Subject: daily autocommit X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=2747ece12d6d1697fd979d3b30d0e74477e0337a;p=config%2Fns1%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..f92a6fe 100644 --- a/logrotate.conf +++ b/logrotate.conf @@ -8,6 +8,12 @@ rotate 99 # create new (empty) log files after rotating old ones create +missingok +notifempty + +dateext +dateformat -%Y-%m-%d + # uncomment this if you want your log files compressed compress delaycompress diff --git a/logrotate.d/apache2 b/logrotate.d/apache2 index 5176131..ca8d9f5 100644 --- a/logrotate.d/apache2 +++ b/logrotate.d/apache2 @@ -6,7 +6,7 @@ compress delaycompress notifempty - size 4M + minsize 4M create 640 root adm sharedscripts postrotate diff --git a/logrotate.d/btmp b/logrotate.d/btmp index e2df517..6b2905a 100644 --- a/logrotate.d/btmp +++ b/logrotate.d/btmp @@ -1,7 +1,7 @@ # no packages own btmp -- we'll rotate it here /var/log/btmp { missingok - monthly + daily create 0660 root utmp rotate 12 dateext diff --git a/logrotate.d/certbot b/logrotate.d/certbot index 05caa95..c3008bb 100644 --- a/logrotate.d/certbot +++ b/logrotate.d/certbot @@ -1,6 +1,8 @@ /var/log/letsencrypt/*.log { rotate 12 weekly + delaycompress + minsize 1M compress 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 diff --git a/logrotate.d/icinga2 b/logrotate.d/icinga2 index df45df7..2b9da8c 100644 --- a/logrotate.d/icinga2 +++ b/logrotate.d/icinga2 @@ -1,6 +1,7 @@ /var/log/icinga2/icinga2.log /var/log/icinga2/debug.log { daily rotate 7 + minsize 1M compress delaycompress missingok @@ -14,6 +15,7 @@ /var/log/icinga2/error.log { daily rotate 90 + minsize 1M compress delaycompress missingok