I wrote a python script to monitor a log file on a CentOS server for a specific value and send an email when it finds it.  It runs as a cron every 5 minutes.
My question is what is the best way to put this script to sleep after it has sent the first email.  I don't want it to be sending emails every 5 mins, but it needs to wake up and check the log again after an hour or so.  This is assuming the problem can be fixed in under an hour.  The people who are receiving the email don't have shell access to disable the cron.
I thought about sleep but I'm not sure if cron will try to run the script again if another process is active (sleeping).
When your scripts sends email, make it also create a txt file "email_sent.txt". Then make it check for existence of this txt file before sending email. If it exists, don't send email. If it does not exist, send email and create the text file.
The text files serves as an indicator that email has already been sent and it does not need to be sent again.
How to sleep a python script running as a cronjob?