bc-clijob command

Set the command that a job will execute on the jobs’ host.

Usage

job command name command [args]

where
name of job whose command to set.
command to execute. See variables for available variables that can be included.
args Optional command arguments.
automatic environment variables

BeyondCron automatically sets the following environment variable upon job execution:

BEYONDCRON_HOST value of job host. e.g. server1
BEYONDCRON_JOB full job name. e.g. /examples/server/backup
BEYONDCRON_JOB_NAME job name. e.g. backup
BEYONDCRON_JOB_GROUP job group. e.g. /examples/server
PATH Default = /usr/local/bin:/usr/bin:/bin, unless ovverridden by the bc-agent environment variable BEYONDCRON_ENVIRONMENT_PATH, or a PATH job property.
TZ Timezone of job, unless overridden by a TZ job property.

write on name

host, input & user for setting the command jobs’ host, input and user.

this command will set the job type to command, and clear any previously set delay, email, message, subject & webhook values as they are unused by command jobs.

Examples

Set a command

BeyondCron % job command /examples/server/reboot reboot
BeyondCron % job list full reboot

----------- ----------------------- Name /examples/server/reboot Description Weekly reboot ... Command reboot ...

Set a command with arguments

BeyondCron % job command /examples/server/backup tmutil startbackup --block
BeyondCron % job list full backup

----------- -------------------------- Name /examples/server/backup Description Business day backup ... Command tmutil startbackup --block ...

Set a command with a variable argument

BeyondCron % job command /examples/variables/calendar /usr/bin/cal -m {{ date MM }}
BeyondCron % job list full calendar

----------- ----------------------------- Name /examples/variables calendar Description Print calendar for this month ... Command /usr/bin/cal -m {{ date MM }} ...

See also