I think that it can be good idea to remove log entries/log files older like 2 months and some maybe earlier.
Possibly Debian (11, linux 5.15) already does that, but checking my logs "ls -lt /var/log" (-t sorts by time change)
I can see some older files too. I would like the /var/log contain much less entries. Currently 95.
Some are:
*.number
*.log.number
*.log.number.gz
I actually do not remember ever extracting old .gz log file for years + these numbered items seems to make rather mess than having one file.
How do you suggest to reduce the log files and get rid of lets say >2 months old entries & files?
https://wiki.debian.org/Logging does not seem to say anything to this topic
sudo journalctl|grep rotate
systemd[1]: logrotate.service: Succeeded.
systemctl status logrotate.service
loaded, inactive (seems ok)
grep . /etc/logrotate.conf
My possibly wrong and unnecessarily complicated idea on how to modify logrotate.conf is:# see "man logrotate" for details
# global options do not affect preceding include directives
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
#dateext
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# system-specific logs may also be configured here.
monthly
rotate 1
shred
dateext
compress
include /etc/logrotate.d
postrotate
find /var/log -type f -mtime +60 -delete
endscript