yii2 cron task manager
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist gofmanaa/yii2-crontask "*"
or add
"gofmanaa/yii2-crontask": "*"
to the require section of your composer.json
file.
Linux OS Yii2
Add to console config:
return [
'bootstrap' => [
'crontask'
],
'modules' => [
'crontask' => [
'class' => 'gofmanaa\crontask\Module',
'fileName'=>'cron.txt', //optional
'params'=>[ '2>&1' ], //common params
'yiiPath' => null // yii execute path
'phpPath' => '/usr/bin/php', //default php path
'tasks'=>[
'dosomething'=>
[
'params'=>[ '--some=something' , '>/dev/null' ], //task params
'command'=>'path/to/controller/action',
'min'=>'*/1',
'hour'=>'*',
'day'=>'*',
'month'=>'*',
'dayofweek'=>'*',
],
'dosomething2'=>
[
'command'=>'path/to/controller/action',
'min'=>'*/2',
],
]
],
],
]
- crontask Provides cron information about console commands.
crontask/index (default) Displays available commands or the detailed information
crontask/ls List App Cron tasks; crontask/ls a All cron jobs
crontask/start Start cron tasks, "crontask/start dosomething2" start single task
crontask/stop Stop App cron. "crontask/stop 3" stop task by index 3
crontask/restart Restart cron tasks