Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
admin_grundlagen:logrotate [2012/02/24 09:08] ingo_wichmann [Neue Logdatei zu logrotate hinzufügen] |
admin_grundlagen:logrotate [2018/10/09 19:16] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | Vorraussetzung: [[cron]] | ||
- | * ''/etc/logrotate.conf'' | ||
- | * ''/etc/logrotate.d/*'' | ||
- | |||
- | ===== Neue Logdatei zu logrotate hinzufügen ===== | ||
- | === Debian 5.0 === | ||
- | ''/etc/logrotate.d/ingo.log'' : | ||
- | <file> | ||
- | /var/log/ingo.log { | ||
- | compress | ||
- | size=+10 | ||
- | postrotate | ||
- | /etc/init.d/rsyslog reload > /dev/null | ||
- | endscript | ||
- | } | ||
- | </file> | ||
- | === SuSE === | ||
- | ''/etc/logrotate.d/ingo.log'' : | ||
- | <file> | ||
- | /var/log/ingo.log { | ||
- | compress | ||
- | size=+10 | ||
- | nodateext | ||
- | postrotate | ||
- | /etc/init.d/syslog restart > /dev/null | ||
- | endscript | ||
- | } | ||
- | </file> | ||
- | |||
- | === CentOS 6 === | ||
- | ''/etc/logrotate.d/ingo.log'' : | ||
- | <file> | ||
- | /var/log/ingo.log { | ||
- | size=+10 | ||
- | dateformat %Y%m%d-%s | ||
- | postrotate | ||
- | service rsyslog reload | ||
- | endscript | ||
- | } | ||
- | </file> | ||
- | |||
- | ==== testen ==== | ||
- | echo 12345678901234567890 >> /var/log/ingo.log | ||
- | logrotate /etc/logrotate.conf | ||
- | ls /var/log/ingo.log* | ||
- | |||
- | |||
- | |||