Log rotation

From vpsget wiki
Jump to: navigation, search

Log rotation is handled by cron job using conf file. Cron job might be stored at the file:

cat /etc/cron.daily/logrotate

Conf file specified in a cron job file, for example:

cat /etc/logrotate.conf

If you'd like to compress "/var/log/messages" you can add the following lines to "/etc/logrotate.conf"

# uncomment this if you want your log files compressed
compress 

  /var/log/messages {
          rotate 5
          weekly
          postrotate
              /usr/bin/killall -HUP syslogd
          endscript
      }