2

in my site runing cron job (but it take RAM and CPU Usage )

So i want to stop cron job

how to stop cron job runing in magento 2

10
  • You can run remove cron command: php bin/magento cron:remove And all cron will be remove
    – fmsthird
    Apr 26, 2019 at 11:53
  • it will delete the codes ...... Apr 26, 2019 at 11:54
  • can i just stop Apr 26, 2019 at 11:55
  • It will just remove all the cron Apr 26, 2019 at 11:55
  • what happen i run php bin/magento cron:remove this comment Apr 26, 2019 at 11:57

2 Answers 2

6

You can by running cron remove command:
php bin/magento cron:remove

It will only remove cron tasks from crontab but not the exact cron codes/files.

If you wish to run the cron jobs again, you just need to run cron run command twice:
php bin/magento cron:run

The first time run is to discover cron tasks to run and the second time — to run the tasks themselves.
The second cron run must occur on or after the scheduled_at time for every task.

3
  • after runing cron:remove can i re:index to complete the process Apr 26, 2019 at 12:07
  • not necessary ..but you can
    – fmsthird
    Apr 26, 2019 at 12:08
  • i have one doubt bro Apr 26, 2019 at 12:23
3

Run this command in magento root CLI

php bin/magento cron:remove

NOTE : This command has no effect on cron jobs outside the #~ MAGENTO START and #~ MAGENTO END comments in your crontab.

and to do it manually

Go -> CLI

then enter crontab -e

an editor will open and go command out the crons which you want to disable.

For more information about creating, running and stop cron visit here

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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