Rails whenever gem: each month on the 20th

后端 未结 4 1913
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 14:20

I searched all over the internet for this, and the documentation isn\'t really talking about monthly jobs in specific. So I was hoping that someone here could tell me how to do

4条回答
  •  逝去的感伤
    2021-02-02 14:55

    Whenever doesn't support an :on option as far as I am aware, but you should be able to do

    every '0 2 20 * *' do
      runner "Mailer.send_friend_sheet"
    end
    

    The '0 2 20 * *' is simply the relevant cron syntax - see http://www.manpagez.com/man/5/crontab/

提交回复
热议问题