1

Consider this in crontab.xml which I've found in a third party plugin...

<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="the_job_name" instance="Vendor\Name\Cron\Order\Retry" method="execute" />
</group>

So it has no <schedule> element. Will it ever fire?

1
  • The short answer is no - not unless you run it May 22, 2019 at 21:13

1 Answer 1

0

It will not run on schedule.

You can check this by running

php bin/magento cron:run

And you can see its not there.

also it will not fire after:

php bin/magento cron:run --group="yourcustom_crongroup"

its on import export module for example:

<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="magento_scheduled_import_export_log_clean" instance="Magento\ScheduledImportExport\Cron\ScheduledLogClean" method="execute" />
    </group>
</config>

There is also one example in unit tests:

vendor/magento/module-cron/Test/Unit/Model/Config/_files/crontab_valid_without_schedule.xml

They will fire after set settings in backend. You don't need it for example for import export on default settings. Only when You decide to have that cron. Probably your module have this settings in the backend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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