문제

How can I execute my cron class in command line especially for testing.

normally one could php -f myfile.php

OR

Calling a method's class: php -r 'include "/path/to/file.php"; ClassName::MethodName();'

I have a Cron class and would like to test in command line to display E.G: 'Hello World!?

올바른 솔루션이 없습니다

다른 팁

Run cron from the command line Command options:

$  bin/magento cron:run [--group="<cron group name>"]

Like $ php bin/magento cron:run --group="customgroupname_cron"

where --group specifies the cron group to run (omit this option to run cron for all groups)

To run the indexing cron job, enter:

bin/magento cron:run --group index

To run the default cron job, enter:

bin/magento cron:run --group default
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top