Skip to main content

Detaching feed generation from magento cron

Reasons to detach:

  • Magento cronjob is not running, or feed fails to generate for whatever reason. 

  • Large catalogs with other backend cron tasks. It may take hours for the cron to generate and this would freeze all other backend tasks for that time. 

Steps to detach:

  1. Disable generation through magento's cron. Do this in the admin > Stores > Configuration > Rocket Shopping Feeds > General Info > Cron Enabled

    grey_arrow_down.pngEarly versions missing this config.

    For versions missing this config in admin, you may obtain same effect by removing the module's cron configuration file: <mage_root>/vendor/rocketweb/module-shopping-feeds/etc/crontab.xml, and clear cache. 

    rm vendor/rocketweb/module-shopping-feeds/etc/crontab.xml php bin/magento cache:flush config
  2. Set dedicated crontab for feed generation. Add the lines below this using for example crontab -e command in your server’s console.

    */10 * * * *  php /<magento_root>/bin/magento rocketshoppingfeed:schedule
    * * * * *     php /<magento_root>/bin/magento rocketshoppingfeed:generate

    Make sure to replace the <magento_root> with the actual path on the server, and the cron is configured under same user group as webserver user in order to maintain file permissions in check. 

Debugging

If you need to check on the output of feed processing, you could run the script over ssh like this:

php /<magento_root>/bin/magento rocketshoppingfeed:generate -vvv

Before you launch this script make sure you set a feed pending for processing. Use the Run Now button in the admin.