Time for action – configuring Logrotate

  1. Logon as root to your Cacti system.
  2. Create a new file in the /etc/logrotate.d directory using vi:
    vi /etc/logrotate.d/cactilog
    
  3. Insert the following code:
    /var/www/html/cacti/log/cacti.log {
        daily
        rotate 7
        copytruncate
        compress
        notifempty
        missingok
    }
  4. Save the file and quit.
  5. Check if the configuration file is correct:
    logrotate /etc/logrotate.conf –v
    
  6. You should see text similar to the following somewhere in the output:
    Time for action – configuring Logrotate

What just happened?

You just created a configuration file for logrotate to manage the Cacti log. The settings you entered will make sure that logrotate will rotate the file on a daily basis, keeping ...

Get Cacti 0.8 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.