https://blog.csdn.net/LJFPHP/article/details/80417552

laravel5.5的定时任务详解(demo) 这篇文章写得挺详细的。看了它我基本就会用了

php artisan make:command Test  新建任务调度文件

app/Console/Commands/Test.php

protected $signature = '<name>'; 定义什么值,就直接在命令行里执行 php artisan <name>
protected $signature = 'command:Test';   命令执行 php artisan command:Test
protected $signature = 'command:scr';   命令执行 php artisan command:scr
//这段代码意思就是在命令行执行时候的名字   php artisan test:data 就可以直接自行此文件了 
protected $signature = 'test:data';
( 实际情况  我是修改了  namespace App\Console; 输入命令 php artisan test:data 才顺利执行了这个文件)
/**
这样就相当于直接调用了StaticPagesController 用在了调度任务中
**/
use App\Http\Controllers\StaticPagesController;
.
.
. public function __construct(StaticPagesController $sp)
{
parent::__construct();
$this->sp = $sp;
}
/**
在 Kernel 任务配置调度文件
**/ class Kernel extends ConsoleKernel
{
protected $commands = [
test::class,
];

ubantu crontab 命令

crontab -e 配置计划任务

crontab -l 查看计划任务

sudo service cron start 启动计划任务

sudo service cron restart 重启计划任务

sudo service cron stop 停止计划任务

sudo service cron status 查看计划任务状态

测试计划任务是否执行

php /home/vagrant/Code/Bi/artisan schedule:run

laravel5.5的任务调度(定时任务)详解(demo)的更多相关文章

  1. CentOS Linux使用crontab运行定时任务详解

    参考博文: (总结)CentOS Linux使用crontab运行定时任务详解

  2. spring定时任务详解(@Scheduled注解)( 转 李秀才的博客 )

    在springMVC里使用spring的定时任务非常的简单,如下: (一)在xml里加入task的命名空间 xmlns:task="http://www.springframework.or ...

  3. spring quartz 配置实现定时任务 详解

    一. 编写定时任务JAVA类 比如: public class QuartzJob {     public QuartzJob(){         System.out.println(" ...

  4. 一.定时任务详解https://i.cnblogs.com/EditPosts.aspx

    定时任务的详解 h每小时运行  d每天运行 w每周运行 m每个月运行  中毒时查看系统定时任务是否有病毒的脚本. crontab  -l  查看用户的定时任务 crontab -e  进入编辑界面增加 ...

  5. spring定时任务详解

    (一)在spring.xml里加入task的命名空间 xmlns:task="http://www.springframework.org/schema/task" http:// ...

  6. android java 设计模式详解 Demo

    android java 设计模式详解 最近看了一篇设计模式的文章,深得体会,在此基础我将每种设计模式的案例都写成Demo的形式,方便读者研究学习, 首先先将文章分享给大家: 设计模式(Design ...

  7. Quartz定时任务详解一

    以下是我在应用的的一个基本配置: #---------调度器属性---------------- org.quartz.scheduler.instanceName = TestScheduler o ...

  8. laravel5.5的定时任务详解(demo)

    原文地址:https://blog.csdn.net/LJFPHP/article/details/80417552

  9. 【Spring Task】定时任务详解实例-@Scheduled

    Spring的任务调度,采用注解的形式 spring的配置文件如下,先扫描到任务的类,打开spirng任务的标签 <beans xmlns="http://www.springfram ...

随机推荐

  1. mysql设置外键约束开启-关闭

    在MySQL中删除一张表或一条数据的时候,出现 [Err] 1451 -Cannot delete or update a parent row: a foreign key constraint f ...

  2. [LeetCode&Python] Problem 122. Best Time to Buy and Sell Stock II

    Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...

  3. ps教程

    http://www.16xx8.com/photoshop/xinshoujiaocheng/

  4. CUDA学习

    CUDA(Compute Unified Device Architecture,统一计算架构)是由NVIDIA所推出的一种集成技术,是该公司对于GPGPU的正式名称.通过这个技术,用户可利用NVID ...

  5. 2018.4.23 git命令总结

    git clone git pull git add xx git add . git add -A git branch 查看本地分支 git branch --all 查看所有分支 git bra ...

  6. django BBS project login登录功能实现

    1.models from django.db import models # Create your models here. from django.contrib.auth.models imp ...

  7. (19)jQuery操作文本和属性

    <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>jq ...

  8. 实验吧—隐写术——WP之 SB!SB!SB!

    我们先打开解题链接,里面是一张愤怒的小鸟里的小猪~ 既然这是隐写题,那么肯定要把图片下载下来进行分析咯~ 下载下来之后,我们看到题目中提示:LSB 什么是LSB? LSB(Least Signific ...

  9. hdu2461 Rectangles 线段树--扫描线

    You are developing a software for painting rectangles on the screen. The software supports drawing s ...

  10. 配置文件schema约束

    解释:https://blog.csdn.net/zh15732621679/article/details/79074380 操作:https://blog.csdn.net/lhg_55/arti ...