- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2018
04:45 AM
07-10-2018
04:45 AM
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?
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2018
05:06 AM
07-10-2018
05:06 AM
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
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2018
05:06 AM
07-10-2018
05:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2018
12:10 AM
07-13-2018
12:10 AM
Re: Custom Cron Jobs
Thanks for pointing to good direction ^^