My Logrotate configuration is as below:
Code: Select all
# cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 2
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# system-specific logs may be also be configured here.
Code: Select all
# cat httpd
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
Under the "/var/log/httpd" directory, I have other suffixes too:
Code: Select all
access_log
access_log-20200718
access_log-20200826
error_log
error_log-20200809
error_log-20200816
error_log-20200823
error_log-20200830
Thank you.