This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
сервис_ротации_журналов [2016/04/19 09:41] val создано |
сервис_ротации_журналов [2026/08/02 08:39] (current) val [Linux Logrotate] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Сервис ротации журналов ====== | ====== Сервис ротации журналов ====== | ||
| - | ==== Linux Ubuntu Logrotate ==== | + | ==== Linux Logrotate ==== |
| <code> | <code> | ||
| # cat /etc/logrotate.conf | # cat /etc/logrotate.conf | ||
| + | </code><code> | ||
| ... | ... | ||
| include /etc/logrotate.d | include /etc/logrotate.d | ||
| ... | ... | ||
| </code><code> | </code><code> | ||
| + | # cat /etc/logrotate.d/mylogs | ||
| + | </code><code> | ||
| + | #/var/log/syslog.high | ||
| + | /var/log/cisco.log | ||
| + | { | ||
| + | rotate 15 | ||
| + | #size 10000k | ||
| + | #size 10M | ||
| + | compress | ||
| + | #create 0640 syslog adm | ||
| + | #create 0640 root adm | ||
| + | postrotate | ||
| + | /bin/systemctl reload rsyslog >/dev/null 2>&1 || true | ||
| + | endscript | ||
| + | } | ||
| + | </code><code> | ||
| + | # logrotate -d /etc/logrotate.d/mylogs | ||
| + | |||
| # logrotate /etc/logrotate.conf | # logrotate /etc/logrotate.conf | ||
| </code> | </code> | ||
| Line 20: | Line 39: | ||
| /var/log/httpd-error.log 644 10 1000 * JC /var/run/httpd.pid 30 | /var/log/httpd-error.log 644 10 1000 * JC /var/run/httpd.pid 30 | ||
| /var/log/httpd-ssl_request.log 644 10 1000 * JC /var/run/httpd.pid 30 | /var/log/httpd-ssl_request.log 644 10 1000 * JC /var/run/httpd.pid 30 | ||
| + | </code><code> | ||
| + | # newsyslog | ||
| </code> | </code> | ||