Skip to Content
Configure an app

Cron jobs

Run a command on a schedule inside an app's or a database's container, and see if it worked.

A nightly cleanup, a report at 6am, php artisan schedule:run. A cron job runs a command in the app's running container, with its variables, as the container's user.

Turn on Cron jobs

Cron jobs are off by default, per app and per database.

Turn it on

Open the app or the database, then Settings -> Advanced, and turn on Cron jobs.

The Cron jobs switch on Settings -> Advanced

Open the tab

A Cron jobs tab appears on the app or the database.

Turning the switch off keeps every job and runs none of them.

Create a job

Open New cron job

On the Cron jobs tab, click New cron job.

The New cron job dialog: schedule, timezone, next run and command

Fill it in

Prop

Type

Advanced has the shell (sh or bash), the Timeout (minutes) (60 by default), Attempts, Runs kept and extra Variables for this job only.

Create it, then try it

Click Create, then Run now on the job to check it works before its first scheduled run.

See if it worked

The cron jobs of an app with their schedule and last result

Open a job to see its runs, each with its output.

StatusWhat it means
RunningRunning now. Retrying between attempts
SucceededIt exited with code 0
FailedIt exited with another code
Timed outIt hit the timeout. Raise it under Advanced if the command needs longer
SkippedIt never started: the container was stopped, or the last run was still going
UnknownDeplo lost track of it. The command may or may not have finished
Lost: its server stoppedThe server stopped during the run, so it may be half done. Deplo never runs it again: use Run now if that is safe

Stop this run stops a running command. The alerts Cron job failed and Cron job finished are in Notifications.

Good to know

  • A job runs without a login shell. A command that works in the Console may need an absolute path here.
  • The job follows the container, so a redeploy does not break it.
  • Creating or running a job needs Manage cron jobs.

Something wrong? See Servers and agents.

Did this page help you?

On this page