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?
1 Answer
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