I want to run a rake task 4 times on Sunday only.
I was thinking of doing the following:
- check if its Sunday => Time.now.wday = 0
- Check if the time is less than 4 am => Time.now < 4:00:00
I would run the task every hour.
Syntax:
if Time.now.wday == 0 && Time.now < 4:00:00
rake "some_rake_task"
end
Would the above work?
I can use the following