calvn / chocolatey-consul

Chocolatey package for Consul
4 stars 27 forks source link

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

Open vchan2002 opened 6 years ago

vchan2002 commented 6 years ago

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 6 years ago

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.