Skip to content

Logrotate

Scott edited this page Aug 1, 2020 · 1 revision

Logrotate

If you plan on using the cron job >> /var/log/mylogfile, you will want to rotate the log so that it doesnt fill up the system.

Here is an example: /etc/logrotate.d/easyping

/var/log/easyping.log {
        daily
        rotate 12
        compress
        delaycompress
        missingok
        notifempty
        create 644 root root
}

For more ways here is a website that explains it: https://linuxconfig.org/logrotate

Clone this wiki locally