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).
@Lennart, @S. Lott: I think the question was somewhat the other way around - the script runs as a cron job every five minutes, but after sending an error-email it shouldn't send another for at least an hour (even if the error state persists).
The obvious answer, I think, is to save a self-log - for each problem detected, an id and a timestamp for the last time an email was sent. When a problem is detected, check the self-log; if the last email for this problem-id was less than an hour ago, don't send the email. Then your program can exit normally until called again by cron.
How to sleep a python script running as a cronjob?