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)?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityhttp://unix.derkeiler.com/Newsgroups/comp.unix.admin/2006-09/msg00132.html
You need to get the PID of your running cron job and then perform simple kill command.
system
command to exec something from your php script and see the output.
May 16, 2011 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.
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'
: )
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.
ps -e
will give you the list of process, andkill processid
(processid is a number)