How to stop cron job correctly commandline

rritz

Member
Hello,
I have a speed problem with mailwizz, sending only 15 to 20 mail per minute at the moment.

So I read all the threads how to solve and I want to try Debug send-campaigns command

But how do I stop the cron job correctly? Using CentOS 6 64bit

I found several ways how to do it, like:
- use the kill command to kill the running process
- comment out or delete the cronjob from crontab
- use crond stop (not sure if this will not stop all cron jobs?)
What is the correct way to do it?
Do I have to reboot the server to make things take effect?

And how to start the cronjob again after debugging?

And another question, I also found I could try to optimize mysql like increasing the buffer pool size. Maybe the issue is there. Do you think this can help?

I have 4 Gig RAM, but I hardly ever go over 6oo MB usage with some spikes at 1GB, and CPU usage is like 0%
so maybe something in the server setup is suboptimal, causing the server to not use the full resources.
 
- comment out or delete the cronjob from crontab
This one.

And how to start the cronjob again after debugging?
Just add it again.

Do I have to reboot the server to make things take effect?
No need for this.

I also found I could try to optimize mysql like increasing the buffer pool size. Maybe the issue is there. Do you think this can help?
I am more than sure it will help.

I have 4 Gig RAM, but I hardly ever go over 6oo MB usage with some spikes at 1GB, and CPU usage is like 0%
so maybe something in the server setup is suboptimal, causing the server to not use the full resources.
This is why you have to set a proper innodb buffer pool size, see https://dba.stackexchange.com/questions/27328/how-large-should-be-mysql-innodb-buffer-pool-size
 
ok, I have done debug, and added the cron job back in now
I could not edit the cron file from cli, although I used crontab -e like befor, when I first edited to delete the cron job I could do so
Now I tried to write something in, but I could not write anything.
I went into ftp and found the file, added the cron job back in
but it is not running. Campaigns stuck in pending-sending and in cron history in backend I can see only transactional sender, bounce and feedback loop processor cron running

When I run crontab -l I get
MAILTO=""
* * * * * php -q /var/www/mw/apps/console/console.php send-campaigns >/dev/null 2>&1
*/2 * * * * php -q /var/www/mw/apps/console/console.php send-transactional-emails > /dev/null 2>&1
*/10 * * * * php -q /var/www/mw/apps/console/console.php bounce-handler > /dev/null 2>&1
*/20 * * * * php -q /var/www/mw/apps/console/console.php feedback-loop-handler > /dev/null 2>&1

*/3 * * * * php -q /var/www/mw/apps/console/console.php process-delivery-and-bounce-log > /dev/null 2>&1

0 0 * * * php -q /var/www/mw/apps/console/console.php daily > /dev/null 2>&1


and it looks almost as it looked before I started editing
only more blank lines in between

Can someone point me what i am doing wrong? Thxs a lot, very much appreciated
 
No error, just couldn't insert anything. -- Insert -- showed up at the bottom, but when I entered text or pasted in nothing appeared
Now I installed different editor, and inserted the cron job back
Now all other crons too stopped working
lol
I must have messed up that crontab file pretty well. I will go and reinstall the server and then come back
 
crontab -e opens the cron tab using vi editor which can be a pain to work with.
Try to use nano instead, so instead of running:
Code:
crontab -e

run

Code:
export VISUAL=nano; crontab -e
 
Back
Top