dcloud deploy jobs create

Add a scheduled job to an app

IAM deploy:CreateJobChanges state

schedule is a five-field cron expression in UTC (minute hour day-of-month month day-of-week, or @hourly/@daily/@weekly/@monthly/@yearly). The command runs with /bin/sh -c in the app’s image with its full environment, on one of the app’s machines, which keeps the schedule itself. concurrency "skip" (default) records a due run as skipped while the previous one is still going.

Synopsis

dcloud deploy jobs create id --name name --schedule schedule --command command [flags]

Arguments

  • <id>Required

    string

    Also accepted as --id. Constraints: uuid

Flags

  • --nameRequired

    string

    Name of the job, unique within the app

    Constraints: 1-63 chars, /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/

  • --scheduleRequired

    string

    When it runs: a five-field cron expression in UTC, or @hourly, @daily, @weekly, @monthly, @yearly

    Constraints: 1-200 chars

  • --commandRequired

    string

    Command run with /bin/sh -c in the app’s image, with the app’s environment

    Constraints: 1-4096 chars

  • --serviceOptional

    string

    Compose apps only: the service whose image and environment the job runs with; omitted or null, the published service

    Constraints: 1-63 chars

    May be null.

  • --enabledOptional

    boolean (--enabled / --no-enabled)

    Whether the job runs on its schedule; a new job is enabled unless this is false

  • --timeout-secOptional

    number

    Seconds a run may take before it is stopped; a new job gets 3600

    Constraints: integer, 10-86400

  • --concurrencyOptional

    enum

    What happens when a run is due while the previous one is still going: skip (a new job’s default) records it as skipped, allow starts it anyway

    One of: skip, allow

  • --timezoneOptional

    object

    Time zone of the schedule; only UTC

    Constraints: JSON

Example

dcloud deploy jobs create id --name example --schedule example --command example

Generated from the API description, the same one the API checks requests against and the CLI is built from.