I need some help to improve the idea/implementation.Scenario is local mini ISP. users accounts are stored in freeradius/mysql. The task is to send user email who have consumed 80% of there assigned quota.
I have configured bash script scheduled run after every 1 hour, that checks for users in mysql table who have downloaded 75% of quota assigned to them and then ADD there username and email to a file /tmp/overquotauser.txt like this
user1 firstname.lastname@example.org user2 email@example.com user3 firstname.lastname@example.org
When user account gets renewed, his name gets removed from the /tmp/overquotauser.txt
Now what I want is to send email to these users, its easy but what I want is to prevent repeated email to user every hour. Example is if a user have consumed 80%, then only one email should send to user, and not every hour. any idea how this can be done?