Jobs usage

Published

Updated

🧰

Background tasks.

Add, edit, start and stop the background jobs of a fortrabbit environment in the dashboard. Each job runs one command, as a scheduled cron or as a non-stop worker.

Jobs are an optional component, see booking and scaling jobs. Once it is booked, the jobs page of the environment in the dashboard adds, edits, removes, starts and stops jobs.

Job settings

  • Job active: an inactive job does not run, and keeps its settings.
  • Job name: for reference in the dashboard.
  • Command: the command to run, see below.
  • Job type: cron or worker.
  • Exit signal: the signal that stops the job on a restart, SIGTERM by default. Keep the default when unsure, see graceful shutdown.
  • Exit timeout: how long the job gets to stop after the exit signal, before SIGKILL ends it.

Crons have two more settings:

  • Interval: a preset or a custom schedule, see the crontab reference.
  • Max runtime: the time after which the cron gets the exit signal. Keep it shorter than the interval, so runs do not overlap.

Command settings

Prefix PHP commands with php and shell scripts with bash. Paths are relative to the code in /data/www:

  • php artisan queue:listen -v
  • bash path/to/my-script.sh

Job types

  • Workers run non-stop, for example to process a queue.
  • Crons run on a schedule.

The output of every job goes to the jobs logs.

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗