Code: Select all
cat /etc/logrotate.d/custom_httpd
/storage/WWW/*/*log {
su root group
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
Code: Select all
logrotate -df /etc/logrotate.d/custom_httpd
[root@hostname logrotate.d]# logrotate -fd /etc/logrotate.d/custom_httpd
reading config file /etc/logrotate.d/custom_httpd
Allocating hash table for state file, size 15360 B
Handling 1 logs
rotating pattern: /storage/WWW/cloud.domain.com/log/*log forced from command line (no old logs will be kept)
empty log files are not rotated, old logs are removed
considering log /storage/WWW/cloud.domain.com/log/access_log
log needs rotating
considering log /storage/WWW/cloud.domain.com/log/error_log
log does not need rotating (log is empty)considering log /storage/WWW/cloud.domain.com/log/ssl_access_log
log needs rotating
considering log /storage/WWW/cloud.domain.com/log/ssl_error_log
log does not need rotating (log is empty)considering log /storage/WWW/cloud.domain.com/log/ssl_request_log
log needs rotating
rotating log /storage/WWW/cloud.domain.com/log/access_log, log->rotateCount is 0
dateext suffix '-20180112'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /storage/WWW/cloud.domain.com/log/access_log.1 to /storage/WWW/cloud.domain.com/log/access_log.2 (rotatecount 1, logstart 1, i 1),
renaming /storage/WWW/cloud.domain.com/log/access_log.0 to /storage/WWW/cloud.domain.com/log/access_log.1 (rotatecount 1, logstart 1, i 0),
rotating log /storage/WWW/cloud.domain.com/log/ssl_access_log, log->rotateCount is 0
dateext suffix '-20180112'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /storage/WWW/cloud.domain.com/log/ssl_access_log.1 to /storage/WWW/cloud.domain.com/log/ssl_access_log.2 (rotatecount 1, logstart 1, i 1),
renaming /storage/WWW/cloud.domain.com/log/ssl_access_log.0 to /storage/WWW/cloud.domain.com/log/ssl_access_log.1 (rotatecount 1, logstart 1, i 0),
rotating log /storage/WWW/cloud.domain.com/log/ssl_request_log, log->rotateCount is 0
dateext suffix '-20180112'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /storage/WWW/cloud.domain.com/log/ssl_request_log.1 to /storage/WWW/cloud.domain.com/log/ssl_request_log.2 (rotatecount 1, logstart 1, i 1),
renaming /storage/WWW/cloud.domain.com/log/ssl_request_log.0 to /storage/WWW/cloud.domain.com/log/ssl_request_log.1 (rotatecount 1, logstart 1, i 0),
fscreate context set to system_u:object_r:public_content_rw_t:s0
renaming /storage/WWW/cloud.domain.com/log/access_log to /storage/WWW/cloud.domain.com/log/access_log.1
disposeName will be /storage/WWW/cloud.domain.com/log/access_log.1
fscreate context set to system_u:object_r:public_content_rw_t:s0
renaming /storage/WWW/cloud.domain.com/log/ssl_access_log to /storage/WWW/cloud.domain.com/log/ssl_access_log.1
disposeName will be /storage/WWW/cloud.domain.com/log/ssl_access_log.1
fscreate context set to system_u:object_r:public_content_rw_t:s0
renaming /storage/WWW/cloud.domain.com/log/ssl_request_log to /storage/WWW/cloud.domain.com/log/ssl_request_log.1
disposeName will be /storage/WWW/cloud.domain.com/log/ssl_request_log.1
running postrotate script
running script with arg /storage/WWW/cloud.domain.com/log/*log : "
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
"
removing old log /storage/WWW/cloud.domain.com/log/access_log.1
error: error opening /storage/WWW/cloud.domain.com/log/access_log.1: No such file or directory