Mainly for rsyslog, there is log rotate.
Log rotate is started by a system D timer
to prevent log files from growing too big.
After rotation, the old file is renamed
to a file with the rotation date as extension.
And when too many files are rotated,
according to the settings, the oldest file will be discarded.
Log rotation is configured in files in etc.logrotate.conf
and etc.logrotate.d.
Let's have a look, trying to understand what's going on.
So here we have the logrotate.conf and logrotate.d.
This is showing the default settings.
So by default, we have weekly rotation.
So every file will be closed after one week,
and a new file will be opened.
This old file will have the date as extension.
And here we can see new file will be created.
And we rotate four, meaning that everything
that happened six weeks ago and longer ago
will disappear for the system.
And that's all to the benefit of making sure
that your system is not filling up completely
with information that has been generated by log files.
Because a misconfiguration of rsyslog
might mean that you need a lot of storage space.