4

I would like to run task every beginning of the month. E.g.:

2017-01-01 00:00:00 // January has just started
2017-02-01 00:00:00 // February has just started ...
...

How to do this using clockwork?

knagode
  • 5,816
  • 5
  • 49
  • 65

1 Answers1

8

Use:

every(1.day, 'myjob', at: '00:00', :if => lambda { |t| t.day == 1 }) do ... end
ishe_ua
  • 169
  • 5