
Moin moin, Am 2018-02-28 10:43, schrieb Werner Franke:
Hallo zusammen,
ich versuche nun schon länger ein funktionierendes logrotate bei Apache Logs hin zu bekommen, aber es will mir nicht gelingen.
In /var/log/httpd bekomme ich immer wieder Files:
-rw-r--r-- 1 root root 39M Feb 28 10:30 access.ong_80 -rw-r--r-- 1 root root 0 Feb 23 03:53 access.ong_80.20180222 -rw-r--r-- 1 root root 0 Feb 24 03:46 access.ong_80.20180222.20180223 -rw-r--r-- 1 root root 0 Feb 25 03:26 access.ong_80.20180222.20180223-20180224 -rw-r--r-- 1 root root 0 Feb 26 03:44 access.ong_80.20180222.20180223-20180224-20180225 -rw-r--r-- 1 root root 0 Feb 27 03:40 access.ong_80.20180222.20180223-20180224-20180225-20180226 -rw-r--r-- 1 root root 0 Feb 28 03:27 access.ong_80.20180222.20180223-20180224-20180225-20180226-20180227 -rw-r--r-- 1 root root 70M Feb 23 10:58 access.ong_80.20180222.20180223-20180224-20180225-20180226-20180227-20180228
Die zugehörige Config lautet:
/var/log/httpd/*_log /var/log/httpd/access.*_80* /var/log/httpd/error.*_80* /var/log/httpd/*.log { rotate 5 size 50M missingok notifempty #dateext #dateformat .%Y%m%d sharedscripts compress postrotate /usr/bin/killall -HUP httpd ls -lhtr /var/log/httpd | /bin/mailx -s "$HOSTNAME: OPTICSDE restarted and log files rotated" werner.franke@nokia.com mv /var/log/httpd/*.gz /var/log/httpd/old_logs endscript }
Kann mir jemand auf die Sprünge helfen, was ich falsch mache ? Es soll z.B. das "access.ong_80", wenn es grösser als 50M ist nach access.ong_80.20180222 umbenannt und dann komprimiert werden. Der Code in postrotate soll dafür sorgen, dass die komprimierten Files auf eine andere Disk verschoben werden, wo mehr Platz ist. /var/log/httpd/old_logs ist ein Softlink dorthin. Die Mail will ich um mitzubekommen, wenn etwas gemacht wurde (solange es nicht so funktioniert, wie es soll)
Ich würde das * hinter der 80 weglassen
Danke für einen Hinweis.
Gruss Werner Franke
lg max -- Um die Liste abzubestellen, schicken Sie eine Mail an: opensuse-de+unsubscribe@opensuse.org Um den Listen Administrator zu erreichen, schicken Sie eine Mail an: opensuse-de+owner@opensuse.org