feyd wrote:Why would you want to execute a cron job based on a trigger? Why wouldn't the cron job monitor MySQL?
I am working on a project, where data are inserted from an automated machine [I don't know exactly how this happen],while inserting I need to check the data, if any new record is found I need to send a mail.
ReverendDexter wrote:Is there a reason it needs to be time based? Or would it be acceptable if it just mailed you every time it got a new row (or 10 new rows, or...)?
Yes, I want to just mail for every new rows inserted
Jcart wrote:is it possible to have a cron job running every minute perform the check for new data?
I think you're approaching this from the wrong side of the problem. If you want an email as soon as it happens, a cron job isn't what you want; cron jobs are for when you want something to happen at a specific time of your choosing.
I'd be looking in to what it takes to have mysql talk to the outside world, if not a trigger than can directly send the mail, then some other method of using the trigger to cause the event. I know that oracle had the ability to send commands to the shell, perhaps MySQL has something along the same lines?
ReverendDexter wrote:
I think you're approaching this from the wrong side of the problem. If you want an email as soon as it happens, a cron job isn't what you want; cron jobs are for when you want something to happen at a specific time of your choosing.