Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

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

Open
vchan2002 opened this issue Mar 23, 2018 · 1 comment

Comments

@vchan2002
Copy link

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
Copy link
Owner

calvn commented Apr 21, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants