您的位置:首页 > 运维架构 > Nginx

使用logrotate做的nginx日志切割

2017-12-30 19:45 761 查看
##使用/etc/crontab定时任务来执行日志切割脚本

59 23 * * * root (/usr/bin/logrotate -f /etc/logrotate.d/nginx)

##将下面的脚本做成配置文件放到/etc/logrotate.d下面,起名为nginx  (当然可以随意起名)

/usr/local/nginx/logs/*.log {

nocompress

daily

copytruncate

rotate 7

missingok

notifempty

dateext

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: