in reply to Re^8: avoiding a race (roll over)
in thread avoiding a race

once an hour has passed you get an e-mail for every single repeat of the same error

To quote my psuedo-code:

a) If it is older than 1 hour: you delete the file; send an email; then move on

As for whether the OP knows what he wants. Not my call. If he changes his spec, then I'd offer a different solution.

I'd also probably close the miniscule window by using O_CREAT | O_EXCL, as discused way back there somewhere.