Automate service restart

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,
I need assistance figuring out the best way to restart a service based on upon the date modifed of files in a directory. I would like to have the service restart if the date modified of the files are older than 15 minutes. Not sure if I should schedule a batch to run and do this every 14 minutes or if there is a better solution. If using that method, I would also need assistance on how to write the batch. Thank you in advance...

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
I think you would need a batch job to check for the modified file. depending on how frequently file changes and what is the time frame you are looking for you may end up with 14 mins interval or longer. Since you have a service, why not add on to that service to see if the file has been modified till the acceptable range, if not then exit out of processing else continue to process. all depends on load etc i would think