I’m not sure how to proper name the question. Please fell free do edit.
I have a background console application running on my server. The console application send emails and do minor stuff from time to time (each 5 minutes).
The application it’s not started every 5 minutes via task manager, it’s opened once in the install process and a infinite loop and thread.sleep keep it running. Because of that I can’t configure the task manager to open the application using a specific parameter.
Now I need to add a task to run every 12 hours, and I want to use the same application. The task consists in delete and create a few files, but check if there’s 12 hours since the last creation based on the files date every 5 minutes looks a bit unwise for me.
Is there a non expensive way (no database, no log, no file creation date, no multi thread) to tick a 12 hours loop using the same application I have? If not, what’s the best way to do that?
Here’s an efficient means of scheduling at midnight utc without looping: