21, "wing" => "Building", "title" => "Jobs on a clock", "promise" => "An app can run a script every few minutes.", "block" => "Add `cron = bin/job.php every 5m` to ratcloud.conf: root runs it as the app, never two at once, with its output in RC_FACTS/log.txt.", "files" => ["bin/tick.php", "ratcloud.conf"], "show" => function (?array $me): string { $t = meta("last_tick"); return "

Last tick: " . ago($t ? (int)$t : null) . ", written by the zoo's own five-minute job.

"; }, "check" => function (): array { $t = (int)meta("last_tick"); if (!$t) return [false, "the job has never ticked"]; $m = intdiv(time() - $t, 60); return $m > 10 ? [false, "the last tick was $m minutes ago"] : [true, "the last tick was " . ($m ? "$m minute(s)" : "under a minute") . " ago"]; }, ];