cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Cron Jobs

SOLVED
Highlighted

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?

 

2 REPLIES

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

Re: Custom Cron Jobs

Thanks for pointing to good direction ^^