When the fileserver shuts down, the program errors and the index fails to update, decimating users' ability to search.
Yeah, that would certainly throw a wrench into everything.
Where is this flag file? A simple batch file can use the
for command to read the contents, extract the date and do the date compare. Using the sleep command you can cycle the file every 10 minutes.
I guess I'm hung up on the possibility that the flag file is checked and while waiting for ten minutes to pass, the server goes into reboot.
I still like the idea of monitoring the server's event log. This way the script gets an immediate notification that a reboot is in progress. If all you want to do is cancel your program, the monitor script can do that for you.
Let us know. Sounds like an interesting mini-project.