calvn/chocolatey-consul

Scheduled job to delete logs is setup to only run when user is logged in.

vchan2002 opened this issue · 1 comments

It would appear that the scheduled job to delete old log files is setup so that it only runs when the user is logged in, which mostly won't be the case... There's a powershell workaround that can be done that I can look into....

$logrotate = ('%SYSTEMROOT%\System32\forfiles.exe /p "{0}" /s /m . /c "cmd /c Del @path" /d -7' -f "$serviceLogDirectory")
SchTasks.exe /Create /SC DAILY /TN ""ConsulLogrotate"" /TR ""$($logrotate)"" /ST 09:00 /F | Out-Null

calvn commented

Thanks for input, this would be good to add! If you do a PR on the required changes I can take a look at it more closely.