Skip to main content

Create

Create a scheduled entry.

If you do not give --user, the value is root. If the object is a Go template, use --content-type template. Then the agent renders it with its facts before it writes the file to disk. Give the values of the template with --var key=value, one --var for each variable.

osapi client node schedule create

Examples​

osapi client node schedule create --target web-01 \
--name backup-daily \
--schedule "0 2 * * *" \
--object backup-script \
--user root

Flags​

FlagDescriptionDefault
--content-typeContent type: raw or template
--intervalPeriodic interval: hourly, daily, weekly, monthly
--nameName for the scheduled entry (required)
--objectName of the uploaded file in the object store (required)
--scheduleCron schedule expression, e.g. "*/5 * * * *"
--userUser to run the command as (default root)
--varTemplate variable as key=value (repeatable)

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file/etc/osapi/osapi.yaml
-T, --targetTarget: _all, _any, hostname, or label (group:web.dev)_all
--urlURL the client will connect tohttp://0.0.0.0:8080

Output tells how the result is printed, and what --json gives.