Solved

Triggering a cron job with Mysql

Posted on 2014-01-15
4
361 Views
Last Modified: 2014-01-17
Hello, can someone let me know how I can trigger a cron job everytime a record is added in one of my tables. Each time a record is added to this table a service running on my Ubuntu machine has to be given a reload command. Can someone let me know how I can do this? Thank you.

A
0
Comment
Question by:aej1973
4 Comments
 
LVL 25

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 100 total points
ID: 39784719
0
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 300 total points
ID: 39787638
If you have multiple users accessing your MySQL db, I'd advise against using lib_mysqludf_sys, for security reasons: they don't need EXECUTE rights to execute UDF scripts.

Just use a script to search (once every few minutes) for COUNT(*) to see if you have inserts.
You can use the language of your choice for that (php, python, bash etc).

HTH,
Dan
0
 
LVL 6

Expert Comment

by:Mahesh Bhutkar
ID: 39788357
Agree with Dan, rather than giving that task on DB, You can write a cron job which check if any new record added inside table which is not processed & then run the process..
0
 

Author Comment

by:aej1973
ID: 39789092
I agree too, thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question