Magento 2 custom corn is not working in my custom module.


<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="review_reminder_cronjob" instance="Namespace\Modulename\Cron\ReminderEmail" method="execute">
        <schedule>* * * * *</schedule>


namespace Namespace\Modulename\Cron;

use Psr\Log\LoggerInterface;

class ReminderEmail
    * Write to system.log
    * @return void

    public function execute()
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->info('Test cron worked successfully');

Run below command :

php bin/magento cron:run

Something is missing or wrong in the code above. can anyone help me to solve out this?

I have already tried below way.

Edit : In my database cron status is Missed or Error

enter image description here

Any help would be appreciated!

  • please specify "not working" Commented Apr 9, 2019 at 6:57
  • </config> is missing in the XML. therefor it's not valid Commented Apr 9, 2019 at 6:58
  • is the module enabled? did you run setup:upgrade and clear the caches? Commented Apr 9, 2019 at 6:59
  • which OS you are using?
    – Avesh Naik
    Commented Apr 9, 2019 at 7:00
  • 1
    Your job name is test_reminder_cronjob but as per as ,your screenshot your job name is different
    – Amit Bera
    Commented Apr 9, 2019 at 9:20

1 Answer 1


Setting cron job in Linux server using below command.

1) Check cron are set or not using below command.

crontab -l

2) Going to magento root Set cron job using below command.

php bin/magento cron:install -f
  • @ChiragPatel is this help for setup cronjob? Commented Apr 9, 2019 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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