Skip to main content

Scheduled tasks

The Scheduled tasks page (menu Serverless) runs jobs on a schedule. Every user can use it.

The Scheduled tasks page with tasks of each type and one row expandedThe Scheduled tasks page with tasks of each type and one row expanded

Task types​

TypeWhat it doesFields
Docker actionStarts, stops, restarts or kills a containerContainer, Action
Docker commandRuns a command in a containerContainer, Command, Working directory
HTTPSends an HTTP requestMethod, URL, Request body, Timeout (seconds)
Function invocationInvokes a function with a fixed event. Admin only, when the functions module is enabledFunction, Event (JSON)

A function invocation keeps the status, duration and response size, never the response itself. The event is at most 64 KB ({} when empty), with at most 5 tasks per function. When the function is deleted, its tasks are Disabled by the panel: point them at another function or delete them.

Create a task​

  1. Click New task.
  2. Fill in Name and Cron expression.
  3. Choose the Type and fill in its fields.
  4. Keep Enabled on. Turn on One-time run to disable the task after its first run.
  5. Click Create.
The new scheduled task form for a Docker commandThe new scheduled task form for a Docker command

The cron expression has five fields, minute hour day month weekday, or a shortcut:

ExpressionRuns
0 3 * * *Every day at 03:00
@every 5mEvery 5 minutes (60 seconds minimum)
@hourly, @daily, @weekly, @monthly, @yearlyEvery hour, day, week, month or year

Manage tasks​

ButtonEffect
EditOpens the task form; save with Update
Run nowRuns the task at once
Suspend / EnableStops or resumes the schedule
DeleteDeletes the task, after confirmation

Expand a row to see the Error: and Output: of the last run. A run never overlaps the previous one of the same task: it is skipped, and the row says when the last run was skipped.

What a user profile can do​

  • Create HTTP tasks, and Docker tasks on the containers granted to you only.
  • See, edit and delete every HTTP task, whoever created it, and the Docker tasks of your containers.
  • The error and output of the last run are shown to administrators only.

Good to know​

  • Command is split on spaces and run without a shell: quotes, pipes and && do not work. Put them in a script inside the container and run sh /path/to/script.sh.
  • HTTP tasks cannot reach private or internal addresses. In the form, Timeout (seconds) goes from 1 to 300.
  • The output kept for a run is limited to 10 KB.
  • Docker commands are refused on the panel's own API container, Docker actions and commands on function containers.
  • The administrator sets the maximum number of tasks on the server (CRON_MAX_JOBS). In the CLI: loch cron, see the loch CLI.