I am currently facing some problem to make whenever running as I wish. For example now it is 2:45pm and I want to my task run every 2 hours from now. So it should run at 4:45pm , 6:45pm, 8:45pm, 10:45pm ...
Thank for your help.
I am currently facing some problem to make whenever running as I wish. For example now it is 2:45pm and I want to my task run every 2 hours from now. So it should run at 4:45pm , 6:45pm, 8:45pm, 10:45pm ...
Thank for your help.
Have you tried official docs? Add (or create that file if it doesn't exist) to config/schedule.rb
:
every 2.hours do
#your task here
end
Or use raw cron syntax, somthing like that should be fine:
every '45 */2 * * *' do
#task
end
This should run job every two hours at xx:45, i.e, 00:45, 2:45, etc.