commands – job 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:
PATH | Default = /usr/local/bin:/usr/bin:/bin, unless overridden 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, image, input & user for setting the command jobs’ host, input and user.
this command will set the job type to command, if the job is not a container job.
Examples
Set a command
BeyondCron % job command /examples/server/reboot reboot
BeyondCron % job show $$
----------- ----------------------- 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 show $$
----------- -------------------------- 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 show $$
----------- ----------------------------- Name /examples/variables calendar Description Print calendar for this month ... Command /usr/bin/cal -m {{ date MM }} ...
See also
- job add
- job calendar
- job changes
- job condition
- job content
- job copy
- job delay
- job delete
- job description
- job diff
- job email
- job enable/disable/bypass
- job history
- job host
- job image
- job input
- job list
- job message
- job output
- job property
- job schedule
- job show
- job sql
- job start/kill
- job status
- job subject
- job timezone
- job trigger
- job url
- job user
- job variables