Skip to content

Cron jobs

Schedule a command to run on an environment, pause or delete it, and read the result of its last run.

Cron jobs run a command on an environment on a schedule. Open your site, then Cron, to add one, pause it, or read what happened the last time it ran.

Open it

  1. Open a site and pick the environment in the top bar.
  2. Choose Cron.

The list shows each job with its schedule and the result of its last run.

Add a cron job

  1. Choose Add cron job.
  2. Pick when it runs. Use the schedule builder for common times, or switch to the cron expression field for anything else.
  3. Enter the command.
  4. Save.

A job can run at most once every 5 minutes. Avaloi refuses a faster schedule and tells you why.

Pause and resume

Pause a job from its switch or its menu. A paused job keeps its schedule and command but does not run. Flip the switch again to resume it.

Read the last run

Open a row to see the last run: the exit code, the output, and when Avaloi removes that output. Avaloi keeps the output for 7 days.

Delete a cron job

Delete from the job's menu. Delete asks you to type the job's description to confirm.

Limits

  • Fastest schedule: once every 5 minutes.
  • Output of the last run is kept 7 days.

Quick answers

Avaloi refused my schedule. The schedule runs more often than every 5 minutes. Choose a slower one. Through the API, the request returns 422 with an explanation.

Does a cron job run on staging too? Cron jobs belong to one environment. Pick the environment in the top bar before you add one.

Where is the output of a run from last month? Avaloi keeps output for 7 days. Older output is gone.

API

  • GET /v1/environments/{id}/cron
  • POST /v1/environments/{id}/cron
  • PATCH /v1/environments/{id}/cron/{cron_id}
  • DELETE /v1/environments/{id}/cron/{cron_id}

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.