Browse documentation

Pharos / Docs / v1.0.0

Web cron

Updated 2026-10-09 · Pharos 1.0.0

Pharos needs its scheduler to run every minute, and normal cron is the way to do that. Some hosts offer no cron, or not every minute. There an outside service can start the scheduler with an HTTPS request. It is a fallback: use real cron wherever you have it.

Switch it on

  1. Make a random token of at least 32 characters, for example with openssl rand -hex 32, and put it in .env:
    PHAROS_WEB_CRON_TOKEN=<your token>
    An installation made with the web installer picks the change up by itself. If the configuration is cached, as after a manual install, run php artisan optimize:clear.
  2. Open Scheduler and backups under Installation. Only administrators see it. The card Web scheduler fallback says Credential configured once Pharos reads the token. The token itself is never shown.
  3. Tick Enable web scheduler and press Save. Without a token of 32 characters or more the switch refuses to go on.
  4. Let an outside scheduler call one of the two addresses on the card every minute, with the token in a header.
POST https://status.example.com/api/cron
GET  https://status.example.com/cron/run

Authorization: Bearer <your token>
curl -fsS -X POST https://status.example.com/api/cron \
  -H "Authorization: Bearer $PHAROS_WEB_CRON_TOKEN"

The token only works in the header. Pharos does not read it from the address, because addresses end up in access logs. A service that can only call a plain URL, with nowhere to set an Authorization header, cannot be used.

What the call answers

AnswerMeaning
200 with {"ok":true}The scheduler ran.
401The token is missing, wrong, or shorter than 32 characters in .env.
404The switch is off.
409An earlier web call is still running. Nothing is lost; the next call picks up.
429More than 2 calls in a minute.
503The scheduler ran but reported a failure. Look in the log.

To stop it, untick the switch, or change the token in .env. Pharos shows the same scheduler warning in the admin as with cron when no run arrives, so you notice when the outside service stops calling.