리눅스 로그관리 - Logrotate
2024-04-23 14:24
1,442
0
0
0
본문
접기
[ ▼ 작성자 참고 Source ]
# vi /etc/logrotate.conf - 스케쥴 지정
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 5
# 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
# logrotate 상세설정
vi /etc/logrotate.d/nginx
/server/nginx/logs/*log {
daily
rotate 5
notifempty
missingok
compress
sharedscripts
postrotate
/server/nginx/sbin/nginx -s reload
endscript
}
# loglotate 실행
/usr/sbin/logrotate -f /etc/logrotate.d/nginx
본문
logtotate는 로그들을 잘관리하도록 설정하는 기능이 logrotate 입니다
0
0
로그인 후 추천 또는 비추천하실 수 있습니다.
댓글목록0