cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 how to set cron config path value

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento 2 how to set cron config path value

Hello,

 

I am working magento 2 extension development. i am now able to set cron config path. I have used following code but it is not working.

i have created crontab.xml and put following code into this xml but this is not workin.

=========

<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="test_cron" instance="MyCompany\Test\Cron\Test" method="execute">            
            <config_path>mycompany/test/cron_daily</config_path>            
        </job>        
    </group>
</config>

=========

 

Please let me know how can i set cron config path value?

 

Thanks

Hardik Patel

1 REPLY 1

Re: Magento 2 how to set cron config path value

Hello Hardikjpatel

 You have not specified the schedule, please look the following code here I am adding the schedule for every minute you can change accordingly.

  

<?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="default">
<job name="expire_query" instance="MyCompany\Test\Cron\Test"
method="execute">
<schedule>* * * * *</schedule>
</job>
</group>
</config>