LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-29-2007, 04:13 AM   #1
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
Possible to call a shell script within a mysql query?


Hi folks,

we have a rather odd request from our employer, which led us to the jobs to somehow make it possible to call a shell script from within a mysql query.

We want to have a mysql query executed on a schedulded base. Which is possible through the included scheduler in mysqld. The tricky part is after this query is done, we like to have shell script to be executed.

Is this possible, and if how can this be done.

Any, realy any input on this is very appreciated.

Greetings Zhjim
 
Old 08-29-2007, 06:13 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
sounds like you want to write a UDF, whatever that is... http://dev.mysql.com/doc/refman/5.0/...functions.html good old google. i'd suggest that maybe you shoudl be looking at things the other way round? shouldn't you be runnign a cron job to ru na stanard mysql query and then forward on the results? that's much simpler and transparent i'd have thought.
 
Old 08-30-2007, 03:23 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

Original Poster
Rep: Reputation: 184Reputation: 184
Thanks for the link to mysql UDF's. I looked through the man ppages of mysql but it seems my eyes were wide shut.

Quote:
Originally Posted by acid_kewpie View Post
i'd suggest that maybe you shoudl be looking at things the other way round? shouldn't you be runnign a cron job to ru na stanard mysql query and then forward on the results? that's much simpler and transparent i'd have thought.
That was my first suggestion also, but for what ever reason it should not be done with cron...
We'll see what comes out in the end.

Thanks for your help


*close*
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
msyql query from shell script hamish Linux - Software 5 06-02-2006 10:06 AM
Makefile call shell script thllgo Programming 4 12-28-2005 10:51 AM
Simple shell script query sachinh Programming 5 09-07-2005 05:02 AM
Shell Script call API treotan Programming 1 08-22-2005 11:59 PM
call a c program in a shell script jagman Programming 4 04-05-2005 05:58 PM


All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration