0

Is it mandatory to reindex all indexes everyday? What are the mandatory ones and what are the optional ones? Below is the crontab details I have and I see some indexers run and some don't. The ones with Jan 7 date were run manually by reindex command yesterday.

* * * * * /usr/bin/php -f /home/site/web/site.com/public_html/bin/magento cron:run &> /dev/null
* * * * * /usr/bin/php -f /home/site/web/site.com/public_html/update/cron.php &> /dev/null
* * * * * /usr/bin/php -f /home/site/web/site.com/public_html/bin/magento setup:cron:run &> /dev/null

enter image description here

1

No you don't have to run indexing everyday, you only have to run when any index will be invalidated. As per screenshot it seems your indexing will run when you update and save any module like when you save any product, product related indexing will run i.e product flat data and so on.

Reindexing can be performed in two modes:

Update on Save - index tables are updated immediately after the dictionary data is changed.
Update by Schedule - index tables are updated by cron job according to the configured schedule.

To set these options:

  1. Log in to the Magento Admin .
  2. Click System > Index Management.
  3. Select the checkbox next to each type of indexer to change.
  4. From the Actions list, click the indexing mode.
  5. Click Submit.

You can reindex by:

Using a cron job, which is preferred because indexing runs every minute.

Using the magento indexer:reindex [indexer] command, which reindexes selected indexers, or all indexers, one time only.

So I think you have to change indexer mode to Using a cron job so you don't have to bother about indexing manually daily.

  • I already have a cron job as you can see from above. – Haya Jan 8 at 6:36
  • But your indexer seems to be set as Update on Save instead of Update by Schedule, so CRON will not help in your current mode – aman Jan 8 at 6:47
  • Thank you. is it okay to truncate cron_schedule table? – Haya Jan 8 at 6:53
  • Yes you can, just take a back of this table before truncate, so that if any thing goes wrong you can restore it – aman Jan 8 at 7:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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