This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
сервис_ротации_журналов [2025/02/18 11:10] val [Linux Logrotate] |
сервис_ротации_журналов [2026/08/02 08:39] (current) val [Linux Logrotate] |
||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ... | ... | ||
| </code><code> | </code><code> | ||
| - | # cat /etc/logrotate.d/cisco | + | # cat /etc/logrotate.d/mylogs |
| </code><code> | </code><code> | ||
| + | #/var/log/syslog.high | ||
| /var/log/cisco.log | /var/log/cisco.log | ||
| { | { | ||
| - | rotate 15 | + | rotate 15 |
| - | size 10000k | + | #size 10000k |
| - | compress | + | #size 10M |
| - | create 640 syslog adm | + | compress |
| - | postrotate | + | #create 0640 syslog adm |
| - | /etc/init.d/rsyslog rotate >/dev/null 2>&1 | + | #create 0640 root adm |
| - | endscript | + | postrotate |
| + | /bin/systemctl reload rsyslog >/dev/null 2>&1 || true | ||
| + | endscript | ||
| } | } | ||
| </code><code> | </code><code> | ||
| - | # logrotate -d /etc/logrotate.d/cisco | + | # logrotate -d /etc/logrotate.d/mylogs |
| # logrotate /etc/logrotate.conf | # logrotate /etc/logrotate.conf | ||