如何在 Laravel 5.2 中使用季度计划指定日期和时间


How do you specify day and time with quarterly schedules in Laravel 5.2?

文档似乎说唯一的选择是quarterly()->when(function() {...});

这可靠吗?每次调度程序运行时,它似乎都会运行每个作业的时间函数,我猜是每分钟一次。这没有问题吗?

如果你看看底层,你会发现季度函数只是调用cron方法(见下文)。 在这种情况下,它将每三个月在第一个小时的第一分钟运行。 cron 字符串的格式可以在这里找到 https://serverfault.com/a/601660 如果您希望进一步自定义您的日程安排。

/**
 * Schedule the event to run quarterly.
 *
 * @return $this
 */
public function quarterly()
{
    return $this->cron('0 0 1 */3 *');
}