How to stop a currently running cron job?
How can I stop a cron job which is currently running?
You can do this the same way you'd stop any process.
To stop a currently running cron
job, you can do one of the following:
pkill process-name
or if you know the PID (you can determine it by running ps
):
kill 1234
(substituting the actual PID)
Strange, no one has mentioned this method:
$ crontab -e
In the opened editor, delete line of the task you want to stop or insert a #
sign, save and exit
e.g.
before
* * * * * some_script1
* * * * * some_script2
after
* * * * * some_script1
#* * * * * some_script2
or
* * * * * some_script1
restart the service after making changes by
sudo service cron reload