I created a scheduled task which runs every night (after the backup run) and removes all old logfiles:
It is a powershell one liner:
powershell.exe Get-ChildItem 'c:\Program Files\Microsoft\Exchange Server\V15\Logging','C:\inetpub\logs' -Directory | Get-ChildItem -Include '*.log','*.blg' -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-7) | Remove-Item
This script will remove all logfiles older than 7 days.
No comments:
Post a Comment