I have created cron for my custom module using this link http://devdocs.magento.com/guides/v2.0/config-guide/cron/custom-cron-ref.html


<?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="test">
        <job name="test" instance="test\Ship\Cron\Observer" method="cronOderSync">
            <schedule>*/5 * * * *</schedule>

And cron_groups.xml

<?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="test">

So I have two issues:

1) when I run bin/magento cron:run [--group="<cron group name>"], it run all crons file.

2) I have setup schedule in cron_group.xml file, but it did not run cron every 5 minutes automatically. 

Run below code and check:

bin/magento cron:run [--group="test"]
  • I run this command but run all cron. – Priya Apr 21 '18 at 7:01
  • @Priya change group id from " <group id="test">" to " <group id="default">" and test please – Chirag Rajput Apr 21 '18 at 7:23

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.