This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
сервис_ротации_журналов [2016/04/19 09:42] val [FreeBSD newsyslog] |
сервис_ротации_журналов [2025/02/18 11:10] (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/cisco | ||
| + | </code><code> | ||
| + | /var/log/cisco.log | ||
| + | { | ||
| + | rotate 15 | ||
| + | size 10000k | ||
| + | compress | ||
| + | create 640 syslog adm | ||
| + | postrotate | ||
| + | /etc/init.d/rsyslog rotate >/dev/null 2>&1 | ||
| + | endscript | ||
| + | } | ||
| + | </code><code> | ||
| + | # logrotate -d /etc/logrotate.d/cisco | ||
| + | |||
| # logrotate /etc/logrotate.conf | # logrotate /etc/logrotate.conf | ||
| </code> | </code> | ||