[Eisfair] LOG-Dateien riesig

Marcus Roeckrath marcus.roeckrath at gmx.de
Mi Nov 20 11:43:41 CET 2019


Hallo Martin,

Martin Mayer wrote:

> ls -lh /var/www/log zeigt bei mir folgendes:
> total 4.8G
> -rw-r--r-- 1 root root   41M Nov 20 10:48 access_log
> -rw-r--r-- 1 root root  1.8M Nov  4  2016 access_log.1.gz
> -rw-r--r-- 1 root root  1.1M Nov 16 23:59 access_log.1.xz
> -rw-r--r-- 1 root root  2.3M Aug 28  2016 access_log.10.gz
> -rw-r--r-- 1 root root  1.4M Sep 15 23:59 access_log.10.xz
> -rw-r--r-- 1 root root  2.1M Oct 23  2016 access_log.2.gz
> -rw-r--r-- 1 root root  1.7M Nov 10 23:59 access_log.2.xz
> -rw-r--r-- 1 root root  3.0M Oct 17  2016 access_log.3.gz
> -rw-r--r-- 1 root root  1.1M Nov  3 00:00 access_log.3.xz
> -rw-r--r-- 1 root root  2.1M Oct  9  2016 access_log.4.gz
> -rw-r--r-- 1 root root  1.4M Oct 27 23:59 access_log.4.xz
> -rw-r--r-- 1 root root 1022K Oct  3  2016 access_log.5.gz
> -rw-r--r-- 1 root root  1.3M Oct 19 23:59 access_log.5.xz
> -rw-r--r-- 1 root root  1.9M Sep 25  2016 access_log.6.gz
> -rw-r--r-- 1 root root  1.7M Oct 13 23:59 access_log.6.xz
> -rw-r--r-- 1 root root  2.7M Sep 19  2016 access_log.7.gz
> -rw-r--r-- 1 root root 1017K Oct  5 23:59 access_log.7.xz
> -rw-r--r-- 1 root root  2.3M Sep 11  2016 access_log.8.gz
> -rw-r--r-- 1 root root  1.6M Sep 29 23:59 access_log.8.xz
> -rw-r--r-- 1 root root  2.6M Sep  5  2016 access_log.9.gz
> -rw-r--r-- 1 root root  1.2M Sep 21 23:59 access_log.9.xz
> -rw-r--r-- 1 root root  3.0G Nov 20 10:47 access_log.ssl
> -rw-r--r-- 1 root root   281 Nov 17 00:00 error_log
> -rw-r--r-- 1 root root   951 Nov  4  2016 error_log.1.gz
> -rw-r--r-- 1 root root   344 Nov 11 00:00 error_log.1.xz
> -rw-r--r-- 1 root root   403 Aug 28  2016 error_log.10.gz
> -rw-r--r-- 1 root root   344 Sep  8 00:00 error_log.10.xz
> -rw-r--r-- 1 root root   320 Oct 23  2016 error_log.2.gz
> -rw-r--r-- 1 root root   344 Nov  3 00:00 error_log.2.xz
> -rw-r--r-- 1 root root   424 Oct 17  2016 error_log.3.gz
> -rw-r--r-- 1 root root   352 Oct 28 00:00 error_log.3.xz
> -rw-r--r-- 1 root root   399 Oct  9  2016 error_log.4.gz
> -rw-r--r-- 1 root root   344 Oct 20 00:00 error_log.4.xz
> -rw-r--r-- 1 root root   463 Oct  3  2016 error_log.5.gz
> -rw-r--r-- 1 root root   344 Oct 14 00:00 error_log.5.xz
> -rw-r--r-- 1 root root   320 Sep 25  2016 error_log.6.gz
> -rw-r--r-- 1 root root   344 Oct  6 00:00 error_log.6.xz
> -rw-r--r-- 1 root root   648 Sep 19  2016 error_log.7.gz
> -rw-r--r-- 1 root root   348 Sep 30 00:00 error_log.7.xz
> -rw-r--r-- 1 root root   422 Sep 11  2016 error_log.8.gz
> -rw-r--r-- 1 root root   344 Sep 22 00:00 error_log.8.xz
> -rw-r--r-- 1 root root   322 Sep  5  2016 error_log.9.gz
> -rw-r--r-- 1 root root   344 Sep 16 00:00 error_log.9.xz
> -rw-r--r-- 1 root root   54K Nov 17 00:00 error_log.ssl
> -rw-r--r-- 1 root root  1.7G Nov 20 10:47 ssl_request_log
> 
> Da gibt es drei Probleme:
> 1) die access_log.ssl wird nach dem rotieren nicht gelöscht
> 2) es sind noch rotierte daten aus dem Jahr 2016 da
> 3) die ssl_request_log wird nicht rotiert

Die mit *.gz kannst du erstmal sofort löschen; wir packen schon eine Weile
mit xz, die gz sind also alt.

Bei der Umstellung auf xz wurden natürlich die vorigen gz gepackzten nicht
entfernt, das muss man manuell tun.

Stoppe mal den Apachen und lösche die unrotierten auch mal; und dann mal
zukünftig schauen, ob die nun rotiert werden.
 
> die /etc/logrotate.d/apache2 schaut so aus (eigendlich gut)
> #---------------------------------------------------------------------
> # /etc/logrotate.d/apache2 file generated by
> /var/install/config.d/apache2.sh
> #
> # Do not edit this file, edit /etc/config.d/apache2.sh
> # Creation Date: 2016-11-16 17:19:49
> #---------------------------------------------------------------------
> /var/www/log/access_log /var/www/log/error_log
> /var/www/log/access_log.ssl /var/www/log/error_log.ssl
> /var/www/log/ssl_request_log {
>     weekly
>     missingok
>     rotate 10
>     compress
>     delaycompress
>     notifempty
>     create 640 root nogroup
>     sharedscripts
>     postrotate
>         /etc/init.d/apache2 restart > /dev/null
>     endscript
> }

Ok.

> es gibt auch noch eine /etc/logrotate.d/apache
> #------------------------------------------------------------------
> # /etc/logrotate.d/apache file generated by Martin Mayer
> #
> # Creation Date: 2009-02-22 Time: 22:32
> #------------------------------------------------------------------
> /var/www/log/access_log /var/www/log/error_log {
>     rotate 10
>     weekly
>     compress
>     postrotate
>         /etc/init.d/apache2 restart
> #        /usr/bin/killall -HUP apache2
>     endscript
> }

Und die ist IMHO von dir selbst erstellt; weg damit.

Für mich sieht es fast so aus, als ob die zum Tragen kommt und nicht die zum
apache2.

> Ich möchte jetzt nicht manuell "unterhalb von eisfair" rummurksen.

Was hast du vor zu tun?

> Unter setup finde ich aber nichts zu logrotate?

Der ist standardäßig aktiv und so wies es aussieht, läuft der auch.

-- 
Gruss Marcus


Mehr Informationen über die Mailingliste Eisfair