Execute local (bash|python) script with mysql SQLIs there an issue with working directory when using service...

Tcolorbox as an item in list environment

What can I substitute for soda pop in a sweet pork recipe?

If nine coins are tossed, what is the probability that the number of heads is even?

Perpetuum Mobile: Where did I think wrong?

Is it possible to convert a suspension fork to rigid by drilling it?

Is there a German word for “analytics”?

Using std::set container for range items

What is a term for a function that when called repeatedly, has the same effect as calling once?

Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?

How to count occurrences of Friday 13th

Why is working on the same position for more than 15 years not a red flag?

Canadian citizen, on US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

Why do members of Congress in committee hearings ask witnesses the same question multiple times?

Is there a frame of reference in which I was born before I was conceived?

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Where was Karl Mordo in Infinity War?

Giving a talk in my old university, how prominently should I tell students my salary?

Plagiarism of code by other PhD student

What is knowledge and vision?

Can we carry rice to Japan?

Did 5.25" floppies undergo a change in magnetic coating?

In the comics did Thanos "kill" just sentient beings or all creatures with the snap?

A "strange" unit radio astronomy

Where is this triangular-shaped space station from?



Execute local (bash|python) script with mysql SQL


Is there an issue with working directory when using service to launch an init script?How to synchronize local MySQL (full access) to remote one (PHP only)how to execute bash script with crontab in centos?Capture Output of Python script in a bash scriptmysql-python with MySQL 5.6Change MySQL root password with bash scriptSSH remote execute local script with argsExecute bash script via PHPExecute local bash scripts on remote server but needs user inputUpgrading a MySQL database using numbered scripts compared to a version field













0















Basically I want to create a trigger so that when a field is updated it kicks off a local bash script (or python...whatever) to kick off a workflow (emails, work requests, etc). Is it possible to execute local system scripts/executables from mysql SQL? My google searches have been unsuccessful.



Thanks!










share|improve this question














bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

    – hmontoliu
    Feb 27 '12 at 15:39


















0















Basically I want to create a trigger so that when a field is updated it kicks off a local bash script (or python...whatever) to kick off a workflow (emails, work requests, etc). Is it possible to execute local system scripts/executables from mysql SQL? My google searches have been unsuccessful.



Thanks!










share|improve this question














bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

    – hmontoliu
    Feb 27 '12 at 15:39
















0












0








0








Basically I want to create a trigger so that when a field is updated it kicks off a local bash script (or python...whatever) to kick off a workflow (emails, work requests, etc). Is it possible to execute local system scripts/executables from mysql SQL? My google searches have been unsuccessful.



Thanks!










share|improve this question














Basically I want to create a trigger so that when a field is updated it kicks off a local bash script (or python...whatever) to kick off a workflow (emails, work requests, etc). Is it possible to execute local system scripts/executables from mysql SQL? My google searches have been unsuccessful.



Thanks!







linux mysql bash python






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 27 '12 at 15:32









PatrickPatrick

4617




4617





bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

    – hmontoliu
    Feb 27 '12 at 15:39





















  • Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

    – hmontoliu
    Feb 27 '12 at 15:39



















Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

– hmontoliu
Feb 27 '12 at 15:39







Check this stackoverflow answer: stackoverflow.com/a/1467387/531201

– hmontoliu
Feb 27 '12 at 15:39












2 Answers
2






active

oldest

votes


















0














It seems not easy to do it. I think it will be better to do it at the application level if at all possible. You can also query your table for updated rows every x minutes and then execute the script in a cron job.






share|improve this answer
























  • To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

    – Khaled
    Feb 27 '12 at 15:44











  • Just default the column to 1 instead of abusing a trigger for this.

    – adaptr
    Feb 27 '12 at 16:22





















0














As already suggested, a once-per-minute cron job that queries a table with pending tasks is the better solution here.



You won't be calling potentially privileged OS code from a database server, and the control over task execution remains firmly in the hands of your application(s).






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "2"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f364158%2fexecute-local-bashpython-script-with-mysql-sql%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It seems not easy to do it. I think it will be better to do it at the application level if at all possible. You can also query your table for updated rows every x minutes and then execute the script in a cron job.






    share|improve this answer
























    • To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

      – Khaled
      Feb 27 '12 at 15:44











    • Just default the column to 1 instead of abusing a trigger for this.

      – adaptr
      Feb 27 '12 at 16:22


















    0














    It seems not easy to do it. I think it will be better to do it at the application level if at all possible. You can also query your table for updated rows every x minutes and then execute the script in a cron job.






    share|improve this answer
























    • To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

      – Khaled
      Feb 27 '12 at 15:44











    • Just default the column to 1 instead of abusing a trigger for this.

      – adaptr
      Feb 27 '12 at 16:22
















    0












    0








    0







    It seems not easy to do it. I think it will be better to do it at the application level if at all possible. You can also query your table for updated rows every x minutes and then execute the script in a cron job.






    share|improve this answer













    It seems not easy to do it. I think it will be better to do it at the application level if at all possible. You can also query your table for updated rows every x minutes and then execute the script in a cron job.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 27 '12 at 15:42









    KhaledKhaled

    31.2k65487




    31.2k65487













    • To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

      – Khaled
      Feb 27 '12 at 15:44











    • Just default the column to 1 instead of abusing a trigger for this.

      – adaptr
      Feb 27 '12 at 16:22





















    • To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

      – Khaled
      Feb 27 '12 at 15:44











    • Just default the column to 1 instead of abusing a trigger for this.

      – adaptr
      Feb 27 '12 at 16:22



















    To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

    – Khaled
    Feb 27 '12 at 15:44





    To recognize the updated rows easily, you can add a new column updated that should be set to 1 to indicate the updated rows. A trigger after update will set this flag to 1 and your script will clear it.

    – Khaled
    Feb 27 '12 at 15:44













    Just default the column to 1 instead of abusing a trigger for this.

    – adaptr
    Feb 27 '12 at 16:22







    Just default the column to 1 instead of abusing a trigger for this.

    – adaptr
    Feb 27 '12 at 16:22















    0














    As already suggested, a once-per-minute cron job that queries a table with pending tasks is the better solution here.



    You won't be calling potentially privileged OS code from a database server, and the control over task execution remains firmly in the hands of your application(s).






    share|improve this answer




























      0














      As already suggested, a once-per-minute cron job that queries a table with pending tasks is the better solution here.



      You won't be calling potentially privileged OS code from a database server, and the control over task execution remains firmly in the hands of your application(s).






      share|improve this answer


























        0












        0








        0







        As already suggested, a once-per-minute cron job that queries a table with pending tasks is the better solution here.



        You won't be calling potentially privileged OS code from a database server, and the control over task execution remains firmly in the hands of your application(s).






        share|improve this answer













        As already suggested, a once-per-minute cron job that queries a table with pending tasks is the better solution here.



        You won't be calling potentially privileged OS code from a database server, and the control over task execution remains firmly in the hands of your application(s).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 27 '12 at 16:22









        adaptradaptr

        15.6k1529




        15.6k1529






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f364158%2fexecute-local-bashpython-script-with-mysql-sql%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

            Список ссавців Італії Природоохоронні статуси | Список |...

            Українські прізвища Зміст Історичні відомості |...