[LINUX] [Centos8] logrotate does not start properly

Introduction

I used logrotate in centos6 so far, but I made a note because there was a stumbling point when I implemented it in centos8.

➀ Challenges

When implemented in centos8, the file is rotated, but the data is not rotated.

➁ A rough flow of logrotate.

(Example) ➀ The logrotate file in /etc/cron.daily starts every minute (calls /etc/logrotate.conf) ↓ ➁ The /etc/logrotate.conf configuration file is read (daily runs the file in the /etc/logrotate.d directory) ↓ There is a syslog file in /etc/logrotate.d. Describe the path of the file you want to rotate in syslog. ↓ The specified file is rotated.

➂ Solution

In centos8, there is a syslog.rpmnew file in the directory /etc/logrotate.d that centos6 did not have. If the contents of two files, syslog and syslog.rpmnew, are duplicated in the logrotate.d directory, they will not be rotated properly. It is necessary to avoid duplication of contents.

➃ Reboot and auto-start after correction

 systemctl restart rsyslog.service
systemctl enable rsyslog.service

⑤ Connection check

Forcibly rotate with the -f option to check if it is rotating properly.

logrotate -f /etc/logrotate.conf

Complete if the data is successfully rotated.

Recommended Posts

[Centos8] logrotate does not start properly
When Anaconda Navigator (Mac) does not start
jupyter notebook does not start on mac fish
Start CentOS 8 using VirtualBox
Ubuntu 20.04 does not start when trying to install nvidia driver
Python version does not switch
distutils log does not appear
Tkinter canvas (window) does not start when running Python 3.7.4 with Atom