Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Triggering a cron job with Mysql

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
aej1973
Asked:
aej1973
2 Solutions
 
Tomas Helgi JohannssonCommented:
0
 
Dan CraciunIT ConsultantCommented:
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
 
Mahesh BhutkarCommented:
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
 
aej1973Author Commented:
I agree too, thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now