Log rotation

From vpsget wiki
Revision as of 16:26, 29 September 2014 by Vq (talk | contribs) (Created page with "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: ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
      }