During a deployment I often find myself restarting the CacheBuilder and watching the log for changes. To make things easier on myself I wrote a quick PowerShell script to stop the service, rename the current log with the current timestamp, and start the service again. This gives me a nice clean log to look through for my troubleshooting. I thought I would share the script here in case anyone else would find it useful.
# Rename current log with timestamp<br> Rename-Item $CacheBuilder "CacheBuilder_$((Get-Date).ToFileTime()).log"<br><br>
# Start CacheBuilder<br> Start-Service CacheBuilder<br>}<br>else<br>{<br> Write-Output "CacheBuilder.log was not found in $Folder"<br>}
# Enter the folder that contains the CacheBuilder.log file<br>$Folder = "C:\InetPub\CiresonPortal\bin\Logs"<br><br>$CacheBuilder = Join-Path $Folder "CacheBuilder.log"<br>If(Test-Path $CacheBuilder)<br>{<br> #Stop CacheBuilder<br> Stop-Service CacheBuilder<br> Start-Sleep 3<br><br>
Comments
To combat the logging disk requirements for my entire SCSM/Cireson farm. I have an old vbs script that also runs nightly to clear older files.
This below script helps with the Cireson IIS logging enabled by default. (I have to update my to hourly otherwise the logs get so big it crashes the system)
*******************************
*******************************