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. 2.5 SeleniumBuilder辅助定位元素

    前言对于用火狐浏览器的小伙伴们,你还在为定位元素而烦恼嘛?上古神器Selenium Builder来啦,哪里不会点哪里,妈妈再也不用担心我的定位元素问题啦!(但是也不是万能,基本上都能覆盖到) 2.5 ...

  2. JAVA基础部分复习(一、8中基础类型,以及String相关内容)

    以下是关于java中8种基本类型的介绍说明: package cn.review.day01; /** * java基础复习,8种数据类型 * (byte,short,long,int,double, ...

  3. JS书写规范

    1.js代码是由语句组成的,每一条语句以分号结尾: 语句是有关键字,元素符,表达式组成的:2.js代码严格区分大小写3.所有的标点符号都是英文的4.//表示单行注释,/* */表示多行注释

  4. HDU - 3982:Harry Potter and J.K.Rowling(半平面交+圆与多边形求交)(WA ing)

    pro:给定一枚蛋糕,蛋糕上某个位置有个草莓,寿星在上面切了N刀,最后寿星会吃含有草莓的那一块蛋糕,问他的蛋糕占总蛋糕的面积比. sol:显然需要半平面交求含有蛋糕的那一块,然后有圆弧,不太方便求交. ...

  5. 牛客HJ浇花。

    我也不知道这是什么类型的题,算是简单模拟吧.但是有个方法很赞. 开两个数组,一个模拟花,一个记录不同浇花次数花的数量: 要找浇水的次数,那么记每次浇水的开头和结尾就行了,a—b;那么f[a]++;f[ ...

  6. deque中的细节问题,以及reverse和max_element的使用

    deque中使用迭代器进行运算的函数都默认以.end()为结束,而实际上.end()所返回的是最后一个元素的下一个位置,所以进行数据比较时,应对其-1才是对应的最后一个数据,而函数中则是直接使用.en ...

  7. Python——dict(自定义类作key)

    Python的dict要求key为不可变数据类型,通常采用str或int,但在某些应用场景下,需要采用自定义类型对象作key, 此时的自定义类需要实现两个特殊方法:__hash__.__eq__,用于 ...

  8. 《DSP using MATLAB》Problem 6.3

    天不亮又醒了,拍了张景象,这就是黎明前的黑暗吗

  9. The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all Stacktrace

    解决地址:https://stackoverflow.com/questions/45776247/mono32-wont-work-mono64-throws-errors 应该是电脑的位与安装的m ...

  10. windows 8,关闭随意窗体都提示“已停止工作”的解决的方法

           电脑用的好好的,突然出现了关闭随意窗体都提示"已停止工作",每次都是这样.想想也就是偶尔优化一下,近期也没有改动过什么系统设置呀,突然想到昨晚JLink_V8固件丢失 ...