【问题标题】:rufus scheduler first day monthsrufus调度器第一天几个月
【发布时间】:2015-10-27 19:06:52
【问题描述】:

我尝试在每个月的第一天执行一次 cron。

我会在每个第一个星期一看到如何做,但在第一天看不到。

scheduler.cron('00 12 * * mon#1') do
     # ...
end

我尝试:

scheduler.cron('00 12 * * #1') do
  # ...
end

我该怎么做?

【问题讨论】:

    标签: ruby-on-rails rufus-scheduler


    【解决方案1】:

    格式为:

    ┌───────────── min (0 - 59)
    │ ┌────────────── hour (0 - 23)
    │ │ ┌─────────────── day of month (1 - 31)
    │ │ │ ┌──────────────── month (1 - 12)
    │ │ │ │ ┌───────────────── day of week (0 - 6)
    │ │ │ │ │
    * * * * *
    
    "0 12 1 * *"
    

    参考:https://en.wikipedia.org/wiki/Cron#Configuration_file

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-30
      • 2021-07-30
      相关资源
      最近更新 更多