I have created a cron group as below,
cron_groups.xml
<?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">
<schedule_generate_every>1</schedule_generate_every>
<schedule_ahead_for>4</schedule_ahead_for>
<schedule_lifetime>2</schedule_lifetime>
<history_cleanup_every>10</history_cleanup_every>
<history_success_lifetime>60</history_success_lifetime>
<history_failure_lifetime>600</history_failure_lifetime>
<use_separate_process>1</use_separate_process>
</group>
</config>
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>
</job>
</group>
</config>
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,
Even after doing that I haven't found the scheduler in cron_schedule
table.