skip to Main Content

I have scheduled my cron in the crontab but it’s not getting scheduled. I have checked in the table cron_schedule but no entry found. I’m setting it according to the server time in UTC format:

<?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="reminder_emails" instance="VendorModuleCronReminderEmails" method="execute">
            <schedule>10 9 * * *</schedule>
        </job>
    </group>
</config>

The cron get executed corrected to the expression like * * * * * and */5 * * * * but not any specific time. Please help me get the format correct.

3

Answers


  1. What enviroment you use to dev (window, mac or linux). Please make sure you had config cron for magento 2. You can use command ‘crontab -e’ in linux to make sure cron havd config for magento.https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html

    Login or Signup to reply.
  2. I think the right format is :

    <schedule>10 */9 * * *</schedule>
    

    It means it will run every 9 hours at minute 10.

    Example 00:10 , 9:10 ….

    Login or Signup to reply.
  3. you can use this link to check your cron job timing format

    Also, you can use command crontab -l to check cron configure on magento.

    You can schedule your cron job using this command: php bin/magento cron:run –group=”default”

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search