dcloud deploy jobs createAdd a scheduled job to an app
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>Requiredstring
Also accepted as
--id. Constraints: uuid
Flags
--nameRequiredstring
Name of the job, unique within the app
Constraints: 1-63 chars, /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/
--scheduleRequiredstring
When it runs: a five-field cron expression in UTC, or @hourly, @daily, @weekly, @monthly, @yearly
Constraints: 1-200 chars
--commandRequiredstring
Command run with /bin/sh -c in the app’s image, with the app’s environment
Constraints: 1-4096 chars
--serviceOptionalstring
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.
--enabledOptionalboolean (--enabled / --no-enabled)
Whether the job runs on its schedule; a new job is enabled unless this is false
--timeout-secOptionalnumber
Seconds a run may take before it is stopped; a new job gets 3600
Constraints: integer, 10-86400
--concurrencyOptionalenum
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--timezoneOptionalobject
Time zone of the schedule; only UTC
Constraints: JSON
Example
dcloud deploy jobs create id --name example --schedule example --command exampleGenerated from the API description, the same one the API checks requests against and the CLI is built from.