How to override cron job group in Magento 2?

You can see your existing cron Group name from your module crontab.xml file.

Override the Module Cron Job group from default to custom group easily. Also, you can change the cron schedule time.

If you want to override any existing Crom Job that contains a default Group, You can change it to your custom group by creating a simple module.

You need to create a simple module with the etc/module.xml and registration.php file.

To Override cronjob, You have to create one extra file under the, etc folder with the etc/crontab.xml file.

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="my_custom_group">
        <job name="product_feed" instance="Rbj\Feed\Model\DataFeed" method="generate">
            <schedule>0 0 * * *</schedule>

Here job name should be the same as your old module contains. product_feed is the Job name and that will be unique among all the Crons of the system.

Now You can define the cron_groups.xml file to define basic cron-related stuff.

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd">
    <group id="my_custom_group">

You can see your custom cron groups from the admin panel and able to manage them.

  1. Log in to the Admin panel.
  2. Click Stores -> Settings -> Configuration -> Advanced -> System.
  3. Check Cron Schedule Section,

To verify your custom group:
Run Magento cron jobs for your custom group

php bin/magento cron:run --group="my_custom_group"
php bin/magento cache:flush

You can see your job scheduled from the cron_schedule table in a database.