laravel 开启定时任务需要操作

1.在xshell 中 

crontab -e  //编辑任务
crontab -l //查看执行中的任务列表

 

  

2.在打开的任务中:

/home/wwwroot/default 换为自己项目的根路径 vagrant/laizheer/
* * * * * /usr/bin/php   /home/wwwroot/default/artisan schedule:run >> /dev/null 2>&1

 3.启动服务

sudo service crond start

 

4.清除任务

crontab -r 
补充:
protected function schedule(Schedule $schedule)
{

 

}

 

posted @ 2019-04-29 16:30  码农编程进阶笔记  阅读(33)  评论(0编辑  收藏  举报
返回顶部 有事您Q我