Skip to content

Cron expressions

Ryan Parman edited this page Mar 31, 2024 · 1 revision

Overview

We want the system to be able to check for updates automatically, once per day, to pickup and build the latest releases.

At the same time, we don't want to overload the CI system by triggering all of the scheduled builds at the same time. We want to space them out, so that they run one-at-a-time. If we run one every 10 minutes…

$(24*60)/10 = 144$

…that gives us 144 slots for packages to run. If we have fewer than 144 packages, this is fine. If we move beyond 144 packages, we can switch to running a scheduled job every 5 minutes.

$(24*60)/5 = 288$

That gives us 288 slots for packages, which should be plenty.

“640kb ought to be enough for anybody.”
often attributed to Bill Gates, 1981

Constructing the cron expression

The currently implemented schedule is documented in List of packages. If you are adding a package, you'll want to select a time slot (from 00:0023:50) that isn't currently used.

For the life of me, I can never remember the supported cron syntax. So I use https://crontab.guru to help me. Generally the format will always be:

MM HH * * *

For example, running at 10:30pm translates to 22:30, so the cron syntax is 30 22 * * *.

Timezones?

Eh, I don't think it matters. We don't really care what time the job runs. We really only care that (a) it runs daily, and (b) its run is spaced-out from the other runs.

Having said that, I think that the GitHub runners are on UTC.