1.在xshell 中 

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

laravel 开启定时任务需要操作

 

  

2.在打开的任务中:

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

 3.启动服务

sudo service crond start

laravel 开启定时任务需要操作

 

4.清除任务

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

 laravel 开启定时任务需要操作

}

 

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2021-04-06
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2021-06-02
  • 2021-12-11
  • 2022-12-23
  • 2021-12-31
相关资源
相似解决方案