Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question

migrated from May 16 '11 at 5:31

This question came from our site for professional and enthusiast programmers.

bg; to get the processes runing, kill to it – Ibu May 16 '11 at 4:49
Please describe how do i kill this? – Sohail May 16 '11 at 4:52
ps -e will give you the list of process, and kill processid (processid is a number) – Ibu May 16 '11 at 4:54
up vote 4 down vote accepted

You need to get the PID of your running cron job and then perform simple kill command.

share|improve this answer
Cron job script file is on host server. I have cPanel only. how do i check all processes by ps -e command? – Sohail May 16 '11 at 5:06
If you don't have any kind of SSH access to command terminal, you can't do that. – Tomasz Kowalczyk May 16 '11 at 5:07
You may use the system command to exec something from your php script and see the output. – Carlos Campderrós May 16 '11 at 11:04

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.

share|improve this answer

someone already wrote u the answer,


  1. ps -e | grep "php name file"

    the above command will display you the process id, so:

  2. kill - 9 'process ID'

    : )

share|improve this answer

Just comment out the specific cron job you want to not run. Switch to the user that controls the task, export your editor of choice into the environment, then use crontab -l:

$ su - root
# EDITOR=vi; export EDITOR
# crontab -l

If you are using cPanel. GO to Advance section of the Corn Job and click the Delete button.

If the delete button is not there, switch cPanel skin to 'X' to view the Delete button.

share|improve this answer
Either you didn't read the question or you failed to understand it. The OP is asking how to stop an already running cron job, not how to edit it. – John Gardeniers May 25 '11 at 4:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.