Please provide me a solution with a code.


2 Answers 2


If you're using ubuntu you can open configured cron jobs by using command crontab -e .

Now let's say you want to run indexer every minute, you can configure it like this

# m h  dom mon dow   command
*/01 * * * * /usr/bin/php /var/www/html/magento2/bin/magento indexer:reindex
  • 1
    This is not the solution. Why would you reindex everything every minute, negating the benefits of the indexes? See Akhilesh comment with link to Magento docs on how to set it up. Commented Aug 2, 2018 at 8:14
  • This was just an example as mentioned in the answer. Of course you have to keep it's impact in mind and set time accordingly.
    – amitshree
    Commented Aug 2, 2018 at 9:56

There is a whole section in the magento develop docs which discuss how to go about setting up the cron and the different scenarios


The only difference is that you would use php bin/magento index:reindex

If you are still stuck you could reach out to your host. If you get someone good they might help you out with what do do that's specific to who you are using.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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