<?xml version="1.0"?>
<group id="custom_crongroup">


<?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="custom_crongroup">
        <job name="monthly_commission" instance="Rewamp\Promotion\Cron\Run" method="execute">
            <schedule>*/5 * * * *</schedule>

This cusotm cron is working correctly when i run the cron,

php bin/magento cron:run

from terminal. But i need to run the cron automatically in every 5 minutes. how can i implement this?.


If it's successfully working from terminal, then you need to set up the actual server cron job to run the command.

Have the cron command run every 1 minute. You're custom cron job however will still only run every 5 minutes because Magento knows when it should be ran.

Below is documentation from the Magento themselves instructing how to do so:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.