Logrotate#
- Timer:
logrotate.timer
- Service:
logrotate.service
- Config files:
/etc/logrotate.conf
/etc/logrotate.d/
Force a rotation of logs:
logrotate --force /etc/logrotate.conf
Logrotate doesn't compress by default, but compression is relatively low cpu cost on modern systems. This author likes to compress logs by default by uncommenting line:
# uncomment this if you want your log files compressed
#compress
sed -i 's/^#compress/compress/' /etc/logrotate.conf