Recent Comments
변군이글루
[Apache] Apache 로그 logrotate(로테이드) 설정 본문
Apache 로그 logrotate(로테이드) 설정
apache logrotate 파일 편집
vim /etc/logrotate.d/apache
$ cat /etc/logrotate.d/apache
/logs/access/*-access-*.log
/logs/error/*-error-*.log
{
daily
rotate 7
notifempty
missingok
compress
delaycompress
sharedscripts
postrotate
/bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
logrotate 실행
/sbin/logrotate -f /etc/logrotate.d/apache
$ /sbin/logrotate -f /etc/logrotate.d/apache
$ ls -l /logs/access
www.sangchul.kr-access-ssl-20210107.log.1
logrotate 실행(상세 내용 출력)
/sbin/logrotate -v /etc/logrotate.d/apache
$ /sbin/logrotate -v /etc/logrotate.d/apache
reading config file /etc/logrotate.d/apache
Allocating hash table for state file, size 15360 B
Handling 1 logs
rotating pattern: /logs/access/*-access-*.log
/logs/error/*-error-*.log
after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /logs/access/test.sangchul.kr-access-20210107.log
log does not need rotating (log has been already rotated)considering log /logs/access/www.sangchul.kr-access-ssl-20210107.log
log does not need rotating (log has been already rotated)considering log /logs/error/*-error-*.log
log /logs/error/*-error-*.log does not exist -- skipping
not running postrotate script, since no logs were rotated
'* 리눅스' 카테고리의 다른 글
[Fabric] fabric hello print on CentOS 8 (0) | 2021.01.11 |
---|---|
[Shell Script] 반복문 for 문법 (0) | 2021.01.07 |
[Apache] Apache 로그 logrotate(로테이드) 설정 (0) | 2021.01.07 |
[명령어] diff 명령어 (0) | 2020.12.31 |
[명령어] sed 명령어 (0) | 2020.12.31 |
[VPN] Linux에서 SoftEther VPN 클라이언트 설치-2 (0) | 2020.12.30 |
- Tag
- Apache, apache logrotate, centos, Linux, logrotate, 로그로테이트, 리눅스, 아파치 로그 로테이트
0 Comments