cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Cron Jobs

SOLVED

Custom Cron Jobs

Hi, I'm no Magento expert, especially not 2.2. I need to run few scheduled cli commands every night, to import product data through Magmi and do some few other basic things through command line.

 

Is the public function in this file, where the specific commands should be run? (I followed through this DOC.

<?php
namespace Zen\ImportCron\Cron;
use \Psr\Log\LoggerInterface;

class cron {
protected $logger;

public function __construct(LoggerInterface $logger) {
$this->logger = $logger;
}

/**
* Write to system.log
*
* @return void
*/

public function execute() {
$this->logger->info('ImportCron');
}

}

Just not even sure what is the syntax for running a cli command from a Magento module?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Custom Cron Jobs

Hello @Zendo

 

 

Try https://github.com/netz98/n98-magerun2 , it is provided command to run any cron.

 

hope it will help you


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

2 REPLIES 2

Re: Custom Cron Jobs

Hello @Zendo

 

 

Try https://github.com/netz98/n98-magerun2 , it is provided command to run any cron.

 

hope it will help you


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Custom Cron Jobs

Thanks for pointing to good direction ^^