Сервис ротации журналов
Linux Logrotate
# cat /etc/logrotate.conf
...
include /etc/logrotate.d
...
# cat /etc/logrotate.d/mylogs
#/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
}
# logrotate -d /etc/logrotate.d/mylogs
# logrotate /etc/logrotate.conf
FreeBSD newsyslog
# cat /etc/newsyslog.conf
...
/var/log/cisco.log 644 7 10 * J
/var/log/httpd-access.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
# newsyslog