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.
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.
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.
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-
Write the command to re-index the data, as
php-cli /home/username/public_html/sub_folder_if_any/bin/magento indexer:reindex
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With