I have a program written in python; my program scrapes a value from some financial website every minute and pushes that value into my DB.  My program takes like 1 or maximum 1.5 seconds to do this job. I have set a cron job to call my program every minute. I need to run my program in this way every day from 9AM to 4PM. Now sometimes I may have to stop my program to kill the program at any time between 9AM to 4PM. How can I do this?According to this linkI tried ps -o pid,sess,cmd afx | grep -A20 cron$  and I was unable to find my program in the list since it completes its work in seconds.Referring to this I tried /etc/init.d/cron stop and pkill cron which kills all cron jobs - which I don't want. I am running this cron in Ubuntu Linux. 
How to stop minute cron job?
linux;ubuntu;cron
Generally, stopping and starting the system cron daemon is a bad idea. Commenting out the line isn't always convenient so here are a couple of related alternativesUse a semaphoreOne solution to this requirement is to use a semaphore - or flag - to indicate whether or not the script is permitted to run. In this instance the semaphore can be represented by the presence or absence of a file: if the file exists then do not run the script, otherwise run it. (Of course, the test could be reversed so that the script only runs if the file exists.)Here is a sample cron entry with the semaphore check in place:* * * * *    test ! -f /tmp/stop && /path/to/script...To prevent the script from running, simply execute touch /tmp/stop. To allow it to start running again, just rm /tmp/stop.To reverse the test, use this test for the file /tmp/run:* * * * *    test -f /tmp/run && /path/to/script...You would probably want to use a different semaphore file in practice to ensure that only authorised people could flag the script to stop (or start). One option might be $HOME/.scriptname.stop for a script called scriptname.Prevent the code runningIf the script is executable, and called by /path/to/script... then simply removing executable permissions or moving it out of the way will stop the script running:chmod a-x /path/to/scriptormv /path/to/script{,.stop}    # i.e. mv /path/to/script /path/to/script.stopThis is a quick and ugly fix that will cause cron to generate an error each time it attempts to run your code. Normally, such errors are caught and emailed to the cron job owner, so a little test before executing the script will prevent this situation being flagged:* * * * *    test -x /path/to/script && /path/to/script...