laravel计划任务每​​月运行10天 [英] laravel schedule task to run every 10 days of a month

查看:72
本文介绍了laravel计划任务每​​月运行10天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务,需要在每个月的前10天执行

I have a task which I need to execute for the first 10 days of every month

类似以下内容:

$schedule->command('log:test')->cron('* * 1-10 * *');

似乎cron()没有得到执行...虽然everyMinute()正常工作...我如何使它工作?

seems cron() is not getting executed... though everyMinute() is working fine... How can I get this to work?

推荐答案

您必须在cron上填写小时和分钟. 如果您希望它在一天的开始执行,请尝试使用它.

You have to fill the hour and minutes on the cron. Try this one if you want it get executed at the start of the day.

$schedule->command('log:test')->cron('0 0 1-10 * *');

这篇关于laravel计划任务每​​月运行10天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆