Scheduler

Introduction

Module for scheduling jobs.

Configuration

Module name: Scheduler

Name
Description

jobs

List of job definitions (see below)

Job Definitions

Name
Description

id

Job identifier. Must be configuration unique.

type

Job type.

schedule

Job schedule in cron format

params

Job parameters hash/dictionary.

Schedules

Schedules are defined using a CRON like expression consisting of six or seven fields:

  1. Seconds (0-59)

  2. Minutes (0-59)

  3. Hours (0-23)

  4. Day of month (1-31)

  5. Month (1-12 or JAN-DEC)

  6. Day of week (1-7 or SUN-SAT)

  7. Year (optional field, such as 2023)

Where each field in the cron expression denotes a specific unit of time.

To run a job to run at 10:30 every day, the cron expression would be:

"0 30 10 ? * *"

  • 0 in the first field represents seconds.

  • 30 in the second field represents minutes (at 30 minutes past the hour).

  • 10 in the third field represents hours (at 10 AM).

  • ? in the fourth field signifies no specific day of the month.

  • * in the fifth field indicates no specific month.

  • * in the sixth field indicates every day of the week.

Job types

The following types of jobs are available:

Type
Description

Pipes

Executes a configured pipe with parameters

Http

Calls an URL with configurable method, headers and parameters.

Exec

Executes a system command

Custom job types can be added by implementing:

foss.platform.api.scheduler.Action

and making implementation and dependencies available to server.

Last updated