Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set cron job for reindex

Tags:

cron

magento

How to setup cron job for clear cache and re-indexing in Magento. i don't know how to set the cron for re-index. but i saw some where every day cron runs defaultly in magento. still i am facing re indexing issues in my site. i need to clear cache also.On Magento website here

they said that logcleaning and reindexing is commented out in the code so in which file I can un-comment to setup cron job fo log cleaning and reindexing?

thanks, murali.

like image 753
krishna Avatar asked Mar 12 '13 06:03

krishna


People also ask

How do I reindex my m2?

Reindexing via Magento 2 AdminLog in to Magento 2 Admin and navigate to System → Index Management. You will see the panel above. Select indexers, which has status Reindex Required, then select in Actions menu Update on Schedule. Press Submit button to apply selected mode to indexers.

What is Reindexing in magento2?

When the data changes, the transformed data must be updated or reindexed. With the support of reindexing, Magento 2 store owners can quickly and correctly change the store data, reduce the waiting time of customers, and increase the conversion rate.


1 Answers

I have tested my solution in my cPanel 11.52.2.4. So stay calm and do following:

Navigate to your magento2 admin area. And click over System > Index Management.

From the Actions drop down select Update by schedule and click on submit.

That is it from admin section. Now navigate to the cPanel area and do following-

  1. Login to your cPanel
  2. Under cPanel click on Cron Jobs under Advanced tab group
  3. If you have already created a cron job, you can edit it, or create a new cron job.
  4. Select the frequency to run the cron job, suppose Once per week (0 0 * * 0).
  5. Write the command to re-index the data, as

    php-cli /home/username/public_html/sub_folder_if_any/bin/magento indexer:reindex

  6. Save it. As per your schedule frequency, the cron job will run.

If you want lesser frequency, but note that if you put less frequency it will consume the resource.

Note: Make sure you replace <username> with your cPanel user name and /<sub_folder_if_any> as per your magento2 installation directory. If you are not using any sub directory just ignore it

like image 187
Kamal Singh Avatar answered Oct 15 '22 12:10

Kamal Singh