godv/yii2-crontab-basic

基于yii2命令行的定时任务框架

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

dev-master 2020-10-27 09:18 UTC

This package is not auto-updated.

Last update: 2024-04-25 01:41:06 UTC


README

基于yii2-crontab扩展创建的一个简易开箱即用包

安装


## 运行

```
WWW\github\yii2-console-basic>php yii crontab/drun
run example/minute 每分钟运行一次
.----------------.-------------.------------------.------------------.--------.------------.--------------.
|     route      | crontab_str |   last_rundate   |   next_rundate   | status | exec_count | exec_time(s) |
:----------------+-------------+------------------+------------------+--------+------------+--------------:
| example/minute | * * * * *   | 2020-10-27 16:41 | 2020-10-27 16:42 | --     | 7          | 0.41         |
| example/hours  | 0 */1 * * * |                  | 2020-10-27 17:00 | --     | 0          | 0            |
'----------------'-------------'------------------'------------------'--------'------------'--------------'
```

## windows模拟linux下crontab服务


```php faker-linux.php```

```
WWW\github\yii2-console-basic>php faker-linux.php
cmd: php yii crontab/drun, next_datetime: 2020-10-27 16:43
run example/minute 每分钟运行一次
.----------------.-------------.------------------.------------------.--------.------------.--------------.
|     route      | crontab_str |   last_rundate   |   next_rundate   | status | exec_count | exec_time(s) |
:----------------+-------------+------------------+------------------+--------+------------+--------------:
| example/minute | * * * * *   | 2020-10-27 16:42 | 2020-10-27 16:43 | --     | 8          | 0.43         |
| example/hours  | 0 */1 * * * |                  | 2020-10-27 17:00 | --     | 0          | 0            |
'----------------'-------------'------------------'------------------'--------'------------'--------------'
```