I know it's possible to do this yourself, but I figured I'd see if anyone knew of something that works like this imaginary command, throttle-check:
check_server_is_ok || throttle-check some_unique-command-key '1 hour' &&\
send_spammy_email
So, throttle-check returns true the first time it is run with a particular key, and then no more than once every <time period> after that.
My use case is a cron job that monitors something that I want to check quite frequently, and send an email as soon as there's a problem, but then not keep spamming the email every time there's a problem.
The command would need to store some persistent state somewhere, I'm pretty sure.
If nobody knows of a nice command I'll just write my own :)