CLI Commands : job

Schedule command execution to occur in the future by specifying a job (a set of CLI commands) and a schedule (when the commands run); or execute a job on demand.
The results of job execution, both output and any error messages, are saved for later inspection. Jobs can be canceled and rescheduled. In either of these cases, any previous output or error messages are retained until the job has runs again. The job state is set to either inactive (if canceled) or pending (if rescheduled).
Jobs are implicitly created by setting a job option. A job is pending when both a time in the future is specified, and the job is enabled. A job may have an empty set of CLI commands. Jobs are specified in local time, meaning that if the time on the system changes, the job occurs in the new local time of the system (assuming that time has not passed).
An arbitrary number of CLI commands may be specified with a job and are executed in the order specified by the set sequence numbers. If a command in the sequence fails, no further commands in the job are executed (unless fail-continue is set). The error message (if any) associated with the job execution reflects the failure of only the last command attempted (which is either the command that failed first if fail-continue is not set, or the last command that produced an error if fail-continue is set).
No two jobs are allowed to run at the same time (i.e. overlap execution). If it comes time for job B to execute while job A is still executing, job B is rescheduled for a short distance in the future (1 second) continually until job A is finished. Each command failure associated with a job is logged to syslog.
If the scheduler is restarted, all previous job state is lost and a previously executed job that was in the completed state, is now in the inactive state and all results are empty.
All jobs are executed implicitly in the context of enable and configure terminal (Configure mode).
job <job_ID> [enable | execute | fail-continue | name <name>]
command <sequence_#> <command_string>
comment <comment_string>
daily time <hh>:<mm>:<ss>
monthly [day-of-month <day>] [interval <months>] [time <hh>:<mm>:<ss>]
once time <hh>:<mm>:<ss> date <yyyy>/<mm>/<dd>
periodic interval <interval_time>
type {once | daily | weekly | monthly | periodic}
weekly {day-of-week <day> | time <hh>:<mm>:<ss>}
Create a job by entering a job identifier (job_ID ), command string, and sequence#, and enable the job (if a job is disabled, the default, it does not execute automatically according to its schedule; nor can it be executed manually), execute, set fail-continue (continue executing commands when one fails), or name the job. Use no job <job_ID> <option> to reset or delete. Notes:
command—Add a CLI command to the job. Enter as many commands as needed.
command_string—The CLI command.
sequence#—An integer that controls the order in which the command is executed relative to other commands in this job; jobs are executed in ascending order.
comment—A string that displays with show job <job_ID>.
schedule—Set scheduling parameters and then implement them by setting a type for the job. Once the parameters are set, they remain so whether used or not. Default is once.
daily—Set the time of day at which a schedule type daily executes every day; use no to reset it the default, which is midnight.
monthly—Set parameters for the schedule type monthly:
day-of-month—Set which day a schedule type monthly executes: a number from 1 - 28 (29-31 not allowed as these days do not exist in every month). Use no to reset the default, 1.
interval—Set the number of months between executions of a monthly job; default is 1, which is the only setting that makes the job truly "monthly." 2 means every two months, etc. Use no to reset the default. Note that you cannot control on which month this starts, if the interval is greater than one; a determination is made automatically based on a start month of January 1970.
time—Specify hours, minutes, and seconds as <hh>:<mm>:<ss> for the time at which monthly scheduled jobs execute.
once—Set the date and time at which a job with schedule type once executes. The no variant resets it to default which is midnight on January 1, 1970 (i.e. no automatic execution, unless your system clock is way off).
periodic—Set the time interval between executions for the schedule type periodic. Use no to reset the default, 1 hour.
type—The type of schedule on which the job automatically executes (one or more future dates and times). Setting a type implicitly changes the job to that recurrence type. Options are:
once—Execute once at the date and time set for schedule once (above).
daily—Execute every day at time set for schedule daily (above).
weekly—Execute weekly as set for schedule weekly (below).
monthly—Execute monthly as set for schedule monthly (above). .
periodic—Execute as set for schedule periodic (above).
weekly—Set the day and time at which a schedule type weekly executes; use no to reset it the default, which is midnight. Options:
day-of-week—Use a three letter code to set a day, or multiple days, one of the following: sun (Sunday), mon (Monday), tue (Tuesday), wed (Wednesday), thu (Thursday), sat (Saturday). If all seven are set, it is the same as schedule daily).
time—Specify hours, minutes, and seconds as <hh>:<mm>:<ss> for weekly execution on the set day(s).
Note! Not all commands can be issued as part of a job; some simply result in a log warning and failure to produce the expected results. A partial list of such commands is: exit, show terminal, telnet, tcpdump, slogin, traceroute, ping, cli session terminal length, cli session terminal width, [no] cli session terminal type, terminal length, terminal width, [no] terminal type, _shell, cli clear-history, [no] cli session auto-logout, [no] cli default auto-logout.

Report an Error
Media Flow Manager Administrator's Guide and CLI Command Reference
Copyright © Juniper Networks, Inc.