2

I have created a custom cron group and below is the code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd">
    <group id="MyCronJob">
        <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>

In the cron group, I'm having 6 job instances and I want to generate the CRON for every 4 hours. so, I have updated the job instance as below

<job name="test_cron" instance="vendor\module\Cron\test" method="execute">
            <schedule>0 */4 * * *</schedule>
</job>

Now my question is, in the CRON group, there is schedule_generate_every, so do I need to update the time in that portion as well and what is the difference which we are giving time in crontab and in crongroups.

Please guide and help.

0

Your Answer

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

Browse other questions tagged or ask your own question.