Logrotate.d


From Docunext Technology Wiki

Jump to: navigation, search

Logrotate is a program which can perform routine maintenance on log files for a variety of reasons, including making sure they don't get too big. It can be instantiated by a cron job.

Here's an example configuration file:

/var/log/auth.log {
   rotate 4
   missingok
   notifempty
   weekly
   compress
}


Syslog-ng can even rotate logs which are fed from other servers:

/var/log/HOSTS/*.log {
  rotate 4
  missingok
  notifempty
  compress
}

I'm using that configuration to rotate logs as I've set them up here. As the manpage for logrotate suggests, the use of the '*' wildcard is appended with .log so that the already rotated and compressed logs are not processed over and over again.

Personal tools