IIS 7日志文件自动删除? [英] IIS 7 Log Files Auto Delete?
问题描述
有没有在IIS 7的任何功能,可以自动删除超过指定天AMT?
Is there any feature in IIS 7 that automatically deletes the logs files older than a specified amt of days?
据我所知,这可以通过编写脚本来完成(并运行它每周)或Windows服务,但我想知道如果有,做任何内置的功能什么的。
I am aware that this can be accomplished by writing a script(and run it weekly) or a windows service, but i was wondering if there is any inbuilt feature or something that does that.
此外,目前我们把注销,因为它是堆放了大量的空间。那将是一个问题吗?
Also, Currently we turned logging off as it is stacking up a large amount of space. Will that be a problem?
推荐答案
您可以创建一个运行日常使用管理工具>任务计划程序的任务。
You can create a task that runs daily using Administrative Tools > Task Scheduler.
设置你的任务是运行以下命令:
Set your task to run the following command:
forfiles /p "C:\inetpub\logs\LogFiles" /s /m *.* /c "cmd /c Del @path" /d -7
这命令是IIS7,它会删除前一周或更旧。
This command is for IIS7, and it deletes all the log files that are one week or older.
您可以通过更改调整的天数/ D
ARG值。
You can adjust the number of days by changing the /d
arg value.
这篇关于IIS 7日志文件自动删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!