find error

I have a directory that our applications are continuely generate new file to it , some files hv a word "error" in content , I would like to find out which file hv this word and send me notify mail to inform me which file hv this word , currently , I have a stupid script to grep the word , the script hv scheduled to run in every 2 hours , it works fine but I worry that if the system is shutting down while the cron job is time to run , then the error checking would be missed in this two hours, this would cause senior problem , furthermore , I am not sure if the checking is correct while the file is generating at the same time , can advise what is the best method , is there any method to check the directory instantly ? if possible , can provide the script ?

Thx in advance.

Running the cronjob when, eventually, machine reboots or fails, is always present. Why don't you use "ls -l folder-name > file-names.txt" ; grep for error and mail the result ? Also, what is the OS, and what is the find option that you are using ?