Beta
This feature is currently beta/experimental and subject to change. It is not recommended for production. Try it out and share your feedback on our GitHub.
A nightly cleanup, a report at 6am, a queue worker tick, php artisan schedule:run.
- The panel decides when, the agent runs it. Restarting or updating the panel does not kill a running job; while the panel is down, nothing new starts.
- It runs in the current container of the service you picked, so a redeploy does not break it. No service picked means the app's own, the one its domain routes to.
- It runs in
sh -corbash -cwith the container's environment, as the container's user. No login shell, no profile files. - Each job has its own timezone, yours by default. 03:00 Europe/Rome is 03:00 in Rome, summer and winter. Backup schedules use UTC instead.
Turn it on
Cron jobs are off by default, per app and per database.
Create the job
A Cron jobs tab appears. Open it and click New cron job.
The switch also pauses every job under it: turned off, the jobs are kept and none runs.
Create a job
The main fields, then Advanced for the rest:
Prop
Type
Reading the run history
| Status | What it means | Alert |
|---|---|---|
| Running | Running now. Retrying between attempts | - |
| Succeeded | Exit code 0 | Cron job finished |
| Failed | It ran and exited non-zero | Cron job failed |
| Timed out | It hit the per-attempt timeout | Cron job failed |
| Skipped | It never started: the container was stopped, or the previous run was still going | None |
| Unknown | The agent could not report the result. Not retried, since the command may have finished | Cron job failed, "outcome unknown" |
| Lost: its server stopped | Only on a cluster: the server stopped while the run was going, so the command may be half done. Never retried, whatever attempts says | Cron job lost with its server |
- Retries share one row: three attempts are one run with an attempt counter.
- The stored output is the last 16 KiB of the last attempt.
- Run now starts a run marked with who triggered it. Stop this run stops the command and everything it started.
- A job that keeps failing alerts once every 30 minutes, not on every run.
- Lost is not Unknown. Unknown means Deplo lost track of a run on a server that is still there, so the command most likely finished. A lost row has its own Run now, which starts a new run on the server running the app now.
Good to know
- A job runs any code as the container's user. That is why
manage_cronsis a sensitive capability and the feature is off by default. - This is not a job queue. No dependencies between jobs, no backoff beyond Attempts.
Troubleshooting
- Every run is Skipped: the container is stopped, or the previous run never finishes.
- This container has no bash. Switch the job to sh.: pick
sh. - This container has no shell, so it cannot run a cron job.: a distroless or scratch image.
- It works in the console and fails here: the console's
/bin/shand/bin/bashstart a login shell, a cron job does not. Use absolute paths, or set what is missing under Variables. - Runs end Unknown: the agent lost contact during the run. Check that server.
More in Servers and agents.
Next steps
Did this page help you?
