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

Nächste Überarbeitung
Vorherige Überarbeitung
admin_grundlagen:logrotate [2010/11/26 13:31]
127.0.0.1 Externe Bearbeitung
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>​ <​file>​
 /​var/​log/​ingo.log { /​var/​log/​ingo.log {
Zeile 22: Zeile 22:
     size=+10     size=+10
     postrotate     postrotate
-        ​/etc/init.d/syslog reload ​> /dev/null+      reload rsyslog >/​dev/​null 2>&1 || true 
 +    endscript 
 +
 +</​file>​ 
 +=== SuSE 12.3 === 
 +''​/etc/logrotate.d/ingo''​ : 
 +<file> 
 +/var/log/​ingo.log { 
 +    compress 
 +    size=+10 
 +    nodateext 
 +    postrotate 
 +        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.1290778305.txt.gz · Zuletzt geändert: 2011/09/22 10:15 (Externe Bearbeitung)