全球主机交流论坛

标题: Nginx下如何分割日志? [打印本页]

作者: youland    时间: 2010-6-6 13:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: monface    时间: 2010-6-6 14:48
logs_path="/home/www/logs/www.acyoo.com.logs/"  这个路径改为自己的
作者: fish    时间: 2010-6-6 15:54
用logrotate
logrotate.conf
/home/wwwroot/logs/*.log {
        daily
        missingok
        compress
        delaycompress
        dateext
        create  
        notifempty
        sharedscripts

        postrotate
                kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
        endscript
}


crontab:
59 23 * * * root logrotate -f /usr/local/nginx/conf/logrotate.conf





欢迎光临 全球主机交流论坛 (https://lilynana.eu.org/) Powered by Discuz! X3.4