Linux利用CronTab定时执行ThinkPHP命令行模式

ThinkPHP试用命令行模式

<?php 
namespace app\appname\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;

class Test extends Command {
    protected function configure() {
        //可选 设置名称与描述
        $this -> setName('this is name') -> setDescription('this is description');
    }
    //具体的执行方法
    protected function execute(Input $input, Output $output) {
        //这里操作具体的实现方法
        echo "Hello World!";
    }

}

Centos7安装和使用Crontab

编写定时启动设置