Search code examples
rubyrufus-scheduler

What happens if the system is off when there is a task scheduled in rufus-scheduler?


In the context of a gem running as a daemon and relying on rufus-scheduler to run tasks at specific intervals: will the scheduler run the task when the laptop is back on/awake if it was off at the time the task was scheduled to run?

i.e. does it behave the same as a cronjob where if you miss your time because the system is off, then it won't run until the next time; or will it run asap after the scheduled time if it wasn't able to run then?

Thanks,


Solution

  • For a cron schedule, rufus-scheduler will run at the next matching time.

    An every schedule should "bomb" and try to trigger for every occurrence that happened while off.

    An interval schedule should trigger then trigger next after the interval time elapsed.

    For another type of schedule (at, in), it should trigger when the system is back on.