Solved

Triggering a cron job with Mysql

Posted on 2014-01-15
4
353 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 34

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to install java on RHEL image on EC2 4 28
mysql update statement 3 23
LINUX backups with VEEAM 8 83
Complex MySQL Query 2 19
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Creating and Managing Databases with phpMyAdmin in cPanel.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

810 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