Home  >  Article  >  Backend Development  >  nginx+php implements cleaning server website logs under Linux system

nginx+php implements cleaning server website logs under Linux system

little bottle
little bottleforward
2019-04-26 16:03:202741browse

本篇文章主要讲述的是在Linux系统下用nginx和php实现清理服务器网站日志,具有一定参考价值,感兴趣的朋友可以了解一下,希望对你能有所帮助。 

1.清空nginx站点日志的内容(如果删除日志文件,只有重启服务器才能重新生成日志文件进行记录)

编辑脚本 

添加定时任务,每月的14号和28号的12点0分执行清理脚本

相关教程:Linux视频教程   nginx视频教程

2.删除iis站点过期的日志(我的日志是天计划,另外一点需要注意的是不能删除当天的日志,因为会有警告说已经在系统打开)



编辑删除脚本 clear.php

编辑bat批处理文件,存放位置任意,双击该文件即可完成删除,此处不做定时任务,手动删除

 相关教程:PHP视频教程 

The above is the detailed content of nginx+php implements cleaning server website logs under Linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete