rockylinux8 - nginx logrotate 轮转

cd /etc/logrotate.d
vim nginx
/var/www/logs/nginx/*.log {
    daily
    size 100M
    missingok
    rotate 14
    compress
    dateext
    delaycompress
    notifempty
    sharedscripts
    postrotate
        [ -f /usr/local/nginx/logs/nginx.pid ] && kill -USR1 $(cat /usr/local/nginx/logs/nginx.pid)
    endscript
}

 

posted @ 2025-01-14 17:03  b̶i̶n̶g̶.̶  阅读(14)  评论(0)    收藏  举报