I am looking to write a script on a Redhat system that will watch a folder for activity. If no new files are created after 10 minutes it will do something (haven't decided what yet - email someone, send an alert of some kind)
Essentially there is a nightly process that kicks off at a certain time each day. While it is running it is writing files to this directory indicating that various parts of the process have completed. When it's finished it creates a file called End.txt signaling that it completed.
So, the script I need would run until it sees that End.txt exists. While it is running it would check for the timestamp of the newest file and compare it to the current time. If the file is older than 10 minutes it would send the alert. It would stop running once the End.txt is located.