Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


admin_grundlagen:logrotate

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
admin_grundlagen:logrotate [2011/09/22 10:15]
ingo_wichmann [Neue Logdatei zu logrotate hinzufügen]
admin_grundlagen:logrotate [2018/10/09 19:16] (aktuell)
Zeile 5: Zeile 5:
 ===== Neue Logdatei zu logrotate hinzufügen ===== ===== Neue Logdatei zu logrotate hinzufügen =====
 === Debian 5.0 === === Debian 5.0 ===
-''/​etc/​logrotate.d/​ingo.log''​ :+''/​etc/​logrotate.d/​ingo''​ :
 <​file>​ <​file>​
 /​var/​log/​ingo.log { /​var/​log/​ingo.log {
Zeile 15: Zeile 15:
 } }
 </​file>​ </​file>​
-=== SuSE === +=== Ubuntu 12.04 === 
-''/​etc/​logrotate.d/​ingo.log''​ :+''/​etc/​logrotate.d/​ingo''​ : 
 +<​file>​ 
 +/var/log/​ingo.log ​
 +    compress 
 +    size=+10 
 +    postrotate 
 +      reload rsyslog >/​dev/​null 2>&1 || true 
 +    endscript 
 +
 +</​file>​ 
 +=== SuSE 12.3 === 
 +''/​etc/​logrotate.d/​ingo''​ :
 <​file>​ <​file>​
 /​var/​log/​ingo.log { /​var/​log/​ingo.log {
Zeile 23: Zeile 34:
     nodateext     nodateext
     postrotate     postrotate
-        ​/​etc/​init.d/​syslog ​restart > /dev/null+        ​service reload ​syslog
     endscript     endscript
 } }
 </​file>​ </​file>​
  
 +=== CentOS 6 ===
 +''/​etc/​logrotate.d/​ingo''​ :
 +<​file>​
 +/​var/​log/​ingo.log {
 +  size=+10
 +  dateformat %Y%m%d-%s
 +  sharedscripts
 +  postrotate
 +    /bin/kill -HUP `cat /​var/​run/​syslogd.pid 2> /dev/null` 2> /dev/null || true
 +  endscript
 +}
 +</​file>​
  
 ==== testen ==== ==== testen ====
   echo 12345678901234567890 >> /​var/​log/​ingo.log   echo 12345678901234567890 >> /​var/​log/​ingo.log
 +  logrotate -d /​etc/​logrotate.conf 2>&1 | less
   logrotate /​etc/​logrotate.conf   logrotate /​etc/​logrotate.conf
 +  grep ingo.log /​var/​lib/​logrotate/​status
   ls /​var/​log/​ingo.log*   ls /​var/​log/​ingo.log*
  
admin_grundlagen/logrotate.1316686549.txt.gz · Zuletzt geändert: 2011/09/22 10:15 von ingo_wichmann