]> Frank Brehm's Git Trees - config/ns1/etc.git/commitdiff
daily autocommit
authorFrank Brehm <frank@brehm-online.com>
Tue, 19 Nov 2019 05:26:43 +0000 (06:26 +0100)
committerFrank Brehm <frank@brehm-online.com>
Tue, 19 Nov 2019 05:26:43 +0000 (06:26 +0100)
cron.daily/logrotate
logrotate.conf
logrotate.d/apache2
logrotate.d/btmp
logrotate.d/certbot
logrotate.d/fail2ban
logrotate.d/icinga2

index 189da6a85946220db6ad7d379efdb9151a264ccc..2166db50b1c6e4e87d3918dec49fdcd21b36d568 100755 (executable)
@@ -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}
index 93870432e04c7f99b8d51ecb064f0eff823473b2..f92a6fe25b0e96f905fc05547e15df40e774554d 100644 (file)
@@ -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
index 5176131807714c339c0cf5cd70cdb7cf6b6b1677..ca8d9f5a1a1f54bc785c757a439c2c6710048387 100644 (file)
@@ -6,7 +6,7 @@
        compress
        delaycompress
        notifempty
-       size 4M
+       minsize 4M
        create 640 root adm
        sharedscripts
        postrotate
index e2df517cbfeb4cca795ae5b09e81ebdbb4d78325..6b2905acb8487d5122cb23cd1476d4d6394fc969 100644 (file)
@@ -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
index 05caa95e253bce2598cc7b2e9523769b7187661b..c3008bb21473267d84e20bf42741411101c4f822 100644 (file)
@@ -1,6 +1,8 @@
 /var/log/letsencrypt/*.log {
     rotate 12
     weekly
+    delaycompress
+    minsize 1M
     compress
     missingok
-}
\ No newline at end of file
+}
index ea46428402d7bff0f321e88c3d9f99bf0d173d89..9556dafbc118f742cd55c1915d900330c468df9a 100644 (file)
@@ -3,6 +3,7 @@
     weekly
     rotate 4
     compress
+    minsize 4M
 
     delaycompress
     missingok
index df45df74aafc234b1a0214258125776c53c10d0e..2b9da8c20eaf9b01f6228a1e00f5a7dbf2a75a38 100644 (file)
@@ -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