I have created a cron group as below,


<?xml version="1.0"?>
 * path:
 * magento_home/app/code/vendor/module/etc/cron_groups.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd">
    <group id="sync_api">

And my crontab.xml as below

<?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="sync_api">

    <job name="custom_cronjob" instance="Ucs\Api\Sync\Test" method="execute">

        <schedule>*/5 * * * *</schedule>




After adding this, I executed, upgrade, compile, cache:clean commands, Once it is done,

I've run a command as php bin:magento cron:run

Once all done, I checked cron_schedule and have found my next cron is not at all scheduled.

Also, in the admin stores->configuration->advance->cron tab I can see my sync_api tab. I have configured Generate Schedules Every as 1.

After all these tries, nothing works.

** Edit **

Obviously, I did cron run by group, Cron Run

Even after doing that I haven't found the scheduler in cron_schedule table.


You have to run your cron group via below code:

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

Also before do this,please clear the cache.

Please follow the below articles for setup custom crontab group at magento 2



  • Yes, I did that too. Refer my updated question. – Butterfly Feb 19 '19 at 9:32
  • I fixed the issue. instance attribute should be instance="Ucs\Api\Controller\Sync\Test" instead of instance="Ucs\Api\Sync\Test". Anyway thanks for your attention. +1 – Butterfly Feb 19 '19 at 10:03
  • 1
    @Butterfly my cron is also not working don't know why while its instance is Vender/Module/Cron/Test when I tried it for first time it was working but after making bit of changing it stop working. – Asad Khan Oct 1 '19 at 6:04
  • @AsadKhan if you think, your latest changes have affected, refer the setup_cron table and see what is the error magento has captured. Also, refer your log files too – Butterfly Oct 1 '19 at 6:06
  • @Amit Bera, In my case, cron is only working when I run the command manually. Why its not running automatically? Please guide – Siva Jun 19 '20 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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