Deploying

Scheduled jobs

Run commands on a cron schedule, or once by hand, from an app's Jobs tab. Some templates come with jobs of their own (Firefly III's cron, say).

Jobs

A job has a name (lowercase letters, digits and dashes, unique in the app), a schedule, a command and a timeout (900 seconds unless set, up to a day). It can be paused.

API: GET/POST /api/apps/{id}/jobs, PUT/DELETE /api/apps/{id}/jobs/{job_id} (enabled: false pauses it).

Schedules are the usual five cron fields, minute hour day-of-month month day-of-week, in UTC: *, numbers, ranges 1-5, lists 1,15, steps */15 or 0-30/10, names for months and weekdays (jan, mon-fri), Sunday as 0 or 7. When both day fields are restricted, a day matching either runs, as in cron. @hourly, @daily (@midnight), @weekly, @monthly and @yearly (@annually) work too. A schedule that never runs (the 31st of February) is refused.

Runs

A job runs once per due time. One still running when it's due again is skipped that time; one missed while the panel was down runs once when it's back, not once per missed time.

A run is a one-shot container of the image the app's web replicas run (the app's image if none does), with the app's variables and database links, like the release command: sh -c with the command, stopped at its timeout. Volumes aren't mounted.

Running by hand

POST /api/apps/{id}/jobs/{job_id}/run runs a job now, paused or not, and POST /api/apps/{id}/run runs any command once the same way ({command, timeout_s}): php artisan migrate:status, a one-off script.

Output and failures

GET /api/apps/{id}/job-runs lists the app's last 100 runs, newest first, and GET /api/apps/{id}/job-runs/{run_id} one with its output (the last 64 KiB, there once it ends). A run that fails says why in a line: its exit code and the last line it printed, its timeout, or that no server could take it. Runs cut off by a panel restart are marked failed. Each job keeps its newest 100 runs, and so do an app's commands run by hand.

A scheduled run that fails sends a job_failed alert.