1

I am a newbie in Magento and I want to understand the Cron Jobs, please.

If I want to create new cron job inside default cron group, but I want to set different schedules time for it, is it possible or I have to create custom cron group.

What is the difference between crontab.xml file and cron_groups.xml file?

In crontab.xml file I see each cron job has its own schedules but in cron_groups.xml file it seems the schedules are general for all cron jobs in the group, which one to use?

crontab.xml file:

<config>
<group id="default">
    <job name="<job_1_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
    <job name="<job_2_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
</group>
<group id="index">
    <job name="<job_3_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
    <job name="<job_4_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
</group>

cron_groups.xml file:

<config>
<group id="<group_name>">
    <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>

I do not understand what is the meaning of sconnector and ddg_automation cron group

1 Answer 1

0

Hi Cron job means any task you want to run periodically and cron group means A cron group is a logical group that enables you to easily run cron for more than one process at a time

you can read more about it at https://devdocs.magento.com/guides/v2.3/config-guide/cron/custom-cron-ref.html

you can define different cron groups for your custom cron if you want to run it separatelly. and also you can define different time for cron history cleanup like that. if you want are new and want to learn magento in depth you can join my youtube channel where we are preparing magento videos in depth. you can take channel links from my profile.

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.