Purpose
Create a scheduled task to delete old logs on the server
Information
This commnad don't need install
Steps
Connect to server, open Windows scheduled tasks
Create a basic Task:
COMMAND: gci 'C:\inetpub\logs\LogFiles' -Include '*.log' -Recurse | ? LastWriteTime -LT (Get-Date).AddDays(-60) | Remove-Item
*gci alias is Get-ChildItem
by GoN | Published: December 28 2022 | Last Updated:
No hay comentarios:
Publicar un comentario