Help with a solution for running a script at an interval (not as simple as it may sound)
I'm building a php-based site for a client who will have users create tasks as part of their account. These task will do different things for the user at the interval set by the user (i.e. send an e-mail reminder, alert a user, send a SMS). The minimum interval would be one minute. So, for instance, send a SMS message every two hours (to remind them to move a car or something). Get the idea?
The database side of things and the actual alert is not a problem. Where I'm having trouble getting my mind around is how to get the alert to actually alert.
I think a cron job is the best solution, but each alert, since they run at different intervals would have to be a line of it's own, right?
Additionally, I wouldn't want one alert that may take longer for one client stall an alert for another client, so having one file that runs through the database and then does the alert doesn't seem like a good, longterm solution (as the site gets more use this may take more than a minute to run).
I thought about using the cron folders and putting things in there, but that starts at hourly.
I've looked and couldn't find a good way to update (or replace) the crontab file each time a new task is added through php.
So, I'm sort of stuck. Anyone have any ideas?
Thanks in advance.
-
Unomateo -
Thanks
{{ DiscussionBoard.errors[4671994].message }} -