Stop an already running cron job
I have a PHP script on server that sends newsletter emails to my site users using a cron job. The users list is approximately 55,000 and takes nine hours.
Is there any way to stop it (urgently)?
http://unix.derkeiler.com/Newsgroups/comp.unix.admin/2006-09/msg00132.html
http://unix.ittoolbox.com/groups/technical-functional/shellscript-l/how-to-kill-the-cronjob-which-is-running-currently-477250
You need to get the PID of your running cron job and then perform simple kill command.
I wouldn't suggest allowing the use of system(), exec(), passthru(), etc. Its a security issue.
If you do have a control panel, there has to be a way to manage the cron jobs, and I believe with most of them you also have the ability to launch an SSH session. You could use this method to stop/start the running process.
Last but not least, if you can't stop it yourself, contact your host.
someone already wrote u the answer,
try:
-
ps -e | grep "php name file"
the above command will display you the process id, so:
-
kill - 9 'process ID'
: )