0

I would like to run my indexer to run over the night since I'm already using the reindex by schedule, how could I do that?

Magento2 indexes running by schedule

0

Changing the schedule

Create a module with the file etc/crontab.xml with the content below to override the default index job and schedule it to run every day at 9 pm.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="indexer_reindex_all_invalid" instance="Magento\Indexer\Cron\ReindexAllInvalid" method="execute">
            <schedule>0 */21 * * *</schedule>
        </job>
    </group>
</config>

Checking the current schedule

You might use the n98-magerun2 to check the actual schedule as the image below shows.

n98-magerun.phar sys:cron:list

enter image description here

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.