Deplo

Cron jobs

Run a command on a schedule (cronjobs) inside one of your containers, tracked by the agent so a panel restart never kills it.

For example: a nightly cleanup, a report at 6am, a queue worker tick, or php artisan schedule:run.


How it works

The panel decides when a job fires. The run itself is tracked by the agent on the server: restarting the panel, upgrading Deplo or losing the dashboard for ten minutes never kills a run in flight. While the panel is down, nothing new starts.

At each occurrence Deplo resolves the target container live, from the Compose service you named, and runs your command in it. It never remembers a container id, so a redeployed app keeps working. With no service named, the job runs in the app's own container: the service its domain routes to.

The command runs in a plain sh -c (or bash -c), with the container's own environment and PATH. No login shell, no profile files.

Each job runs in its own timezone, unlike a backup schedule, which is UTC. A job that says 03:00 Europe/Rome means 03:00 in Rome, in summer and in winter.


Turn it on

Cron jobs are opt-in per app and per database, and the switch is also the pause button for everything underneath it.

Open the app's Advanced settings

Open the app, then Settings -> Advanced.

Turn on cron jobs

Turn on Cron jobs.

Create the job

A Cron jobs tab appears. Open it and click New cron job.

For a database it is the same, in Settings -> Advanced of that database.


Create a job

Prop

Type


Reading the run history

Six statuses, and the distinctions matter:

Prop

Type

Retries share one row, so a job with three attempts is one run with an attempt counter, not three rows. The stored output is the last attempt's final 16 KiB. Run now produces a run marked as manually triggered.

Limits and gotchas

  • This is arbitrary code as the container's user, with no sandbox. That is why manage_crons is flagged sensitive and why the feature is off until somebody turns it on.
  • The switch pauses everything. Turning it off leaves the jobs defined and stops all of them.
  • A stopped app runs nothing. Occurrences are skipped, quietly and on purpose.
  • Stopping a run stops the command. A timeout, or the Stop button, kills the command and everything it started inside the container.
  • A job that keeps failing alerts once every 30 minutes, not on every run. The first success after that arms the alert again.
  • Timezones are per job. Two jobs on one app can sit in two zones.
  • This is not a job queue. No fan-out, no dependencies, no retry backoff beyond the attempt count.

If it does not work

  • Every run is skipped: the container is stopped, or the previous run never finishes.
  • shell not found: the image has no bash. Choose sh.
  • The command works in the console and fails here: both see the container's own environment, but the console is an interactive login shell and a cron job is not. Anything a profile or rc file sets up is not there: use absolute paths, or set it under Variables.
  • Runs go lost: the agent lost contact mid-run. Check that server.

See Servers and agents for more.


See also

Did this page help you?

On this page