I do it through “logrotate”. The config file is /etc/logrotate.d/syslog. Read the man page for logrotate to get familiar with all the config options. You can set it up to rotate weekly or more and only keep X number of old log files.
#
# Please note, that changing of log file permissions in this
# file is not sufficient if syslog-ng is used as log daemon.
#
# It is required to specify the permissions in the syslog-ng
# configuration file /etc/syslog-ng/syslog-ng.conf as well.
#
# the firewall,acpid,NetworkManager log files
# are used by syslog-ng and rsyslog only, the
# other by all syslog daemons.
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}
# used by all syslog daemons
/var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}
# used by all syslog daemons
/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 news news
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}
I suspect “maxage 365” maybe the time the logfile(s) will be kept
maxage count
Remove rotated logs older than <count> days. The age is only checked if the logfile is to be rotated. The files are
mailed to the configured address if maillast and mail are configured.
Laptop has the same settings but was only recently fresh 11.3 installed. I better have a look into the logfiles, maybe there is something not quite right.:\