Run Klevu CRON independent of Magento 1 CRON

In case of larger product catalogs, from lots of processes relying on Magento cron, sometimes klevu cron keeps on running all the time or will be in a queue because of other module crons.

To avoid this, as an alternative, one can setup an external shell script that runs independently of Magento cron.

Note: Magento 1 version should be greater than or equal to 1.2.8

Follow the steps below to setup external script in Magento 1:

  1. Login into Magento Admin Panel
  2. Go to System → Configuration
  3. Open Search Configuration under Klevu
  4. Select option Never for Frequency under Data sync settings (the option is visible at default config level)
  5. Click on Save Config
  6. Set up Klevu’s incremental sync script as an external CRON job. Here is the command to setup the same:

    cd <magento-root-folder>/shell/klevu && php sync.php --updatesonly

    Note: Please remember to change <magento-root-folder> with the actual path of your Magento root folder

Debugging the Script Execution Issues

Every time the sync.php is executed, it creates a file called <magento-root-folder&rt;/shell/klevu/klevu_running_index.lock. This is to indicate that the execution is in progress and to prevent another instance of the same script getting executed at the same time. The lock file is automatically deleted towards the end of the successful execution of the script.

If for some reason, your sync is not working, we recommend that you check for the presence of the above lock file. If it is present, please delete it manually.