December 2015
Intermediate to advanced
250 pages
4h 41m
English
The logrotate tool allows you to rotate the logs that are generated by applications and scripts
It keeps your log directories clutter-free and minimizes disk usage when correctly configured.
The logrotate tool is installed by default, but I will include the installation instructions here for completeness. This recipe will show you how to rotate logs for rsyslog. We will rotate the logs everyday, add an extension based on the date, compress them with a one-day delay, and keep them for 365 days. Perform the following steps:
logrotate, perform the following command:
~]# yum install -y logrotate
~]# systemctl restart crond
/etc/logrotate.d/syslog ...