CRON Commands

cron

Syntax

cron

Context

config>system

Description

This command enables the context to configure periodic and date- and time-based scheduling.

CRON can be used, for example, to schedule Service Assurance Agent (SAA) functions. CRON functions include the ability to specify scripts that need to be run and when they are scheduled. Reboots, peer turn-ups, and SAA tests can be scheduled with CRON, as well as OAM events such as connectivity checks or troubleshooting runs.

schedule

Syntax

[no] schedule schedule-name [owner schedule-owner]

Context

config>system>cron

Description

This command configures a schedule name and optional schedule owner.

Default

no schedule

Parameters

schedule-name

the name of the schedule, up to 32 characters in length

schedule-owner

the name of the owner, up to 32 characters in length. The owner name is an arbitrary string; it is not associated with an actual CLI user.

Default

‟TiMOS CLI”

count

Syntax

count number

no count

Context

config>system>cron>schedule

Description

This command configures the number of times a CRON periodic schedule is run. For example, if the interval is set to 600 and the count is set to 4, the schedule runs 4 times at 600-second intervals.

Default

no count

Parameters

number

the number of times the schedule is run

Values

1 to 65535

day-of-month

Syntax

day-of-month {day-number [..day-number] | all}

no day-of-month

Context

config>system>cron>schedule

Description

This command specifies on which days of the month the schedule executes. Multiple days of the month can be specified. If multiple days are configured, each of them triggers the schedule. If a day-of-month is configured without configuring month, hour, and minute, the schedule does not execute.

Using the weekday command as well as the day-of-month command may cause the schedule to run twice in a week. For example, if today is Monday, January 1, and month is set to January, weekday is set to Tuesday, and day-of-month is set to the 5th day of the month, the schedule runs on Tuesday (January 2) and on Friday (January 5).

The no form of this command removes the specified day-of-month or all day-of-month configurations.

Default

no day-of-month

Parameters

day-number

positive integers specify the day of the month beginning on the first of the month. Negative integers specify the day of the month beginning on the last day of the month. For example, configuring day-of-month -5, 5 in a month that has 31 days specifies the schedule to execute on the 27th and 5th of that month.

Integer values must map to a valid day for the specified month. For example, February 30 is not a valid date.

Values

1 to 31, -31 to -1 (maximum 62 day-numbers)

all

specifies all days of the month

end-time

Syntax

end-time [date | day-name] time

no end-time

Context

config>system>cron>schedule

Description

This command is used concurrently with schedule type calendar or periodic. If the schedule is configured as calendar, the end-time determines on which date the schedule ends. If the schedule is configured as periodic, the end-time determines at which interval the schedule ends.

If no end-time is specified, the schedule runs indefinitely.

Default

no end-time

Parameters

date

the date that the schedule ends

Values

yyyy/mm/dd in year/month/day number format

day-name

the day of the week that the schedule ends

Values

sunday | monday | tuesday | wednesday | thursday | friday | saturday

time

the time on the configured day that the schedule ends

Values

hh:mm in hour:minute format

hour

Syntax

hour {..hour-number [..hour-number] | all}

no hour

Context

config>system>cron>schedule

Description

This command specifies at which hour the schedule executes. Multiple hours can be specified. If multiple hours are configured, each of them triggers the schedule. If an hour is configured without configuring month, weekday or day-of-month, and minute, the schedule does not execute.

The no form of this command removes the specified hour or all configured hours.

Default

no hour

Parameters

hour-number

the hour that the schedule executes

Values

0 to 23 (maximum 24 hour-numbers)

all

specifies all hours

interval

Syntax

interval seconds

no interval

Context

config>system>cron>schedule

Description

This command specifies the interval between each periodic schedule run.

Default

no interval

Parameters

seconds

the interval, in seconds, between each schedule run

Values

30 to 4294967295

minute

Syntax

minute {minute-number [..minute-number] | all}

no minute

Context

config>system>cron>schedule

Description

This command specifies at which minute the schedule executes. Multiple minutes can be specified. If multiple minutes are configured, each of them triggers the schedule. If a minute is configured without configuring month, weekday or day-of-month, and hour, the schedule does not execute.

The no form of this command removes the specified minute or all configured minutes.

Default

no minute

Parameters

minute-number

the minute that the schedule executes

Values

0 to 59 (maximum 60 minute-numbers)

all

specifies all minutes

month

Syntax

month {month-number [..month-number] | month-name [..month-name] | all}

no month

Context

config>system>cron>schedule

Description

This command specifies on which month the schedule executes. Multiple months can be specified. If multiple months are configured, each of them triggers the schedule. If a month is configured without configuring weekday or day-of-month, hour, and minute, the schedule does not execute.

The no form of this command removes the specified month or all configured months.

Default

no month

Parameters

month-number

the month that the schedule executes, by number

Values

1 to 12 (maximum 12 month-numbers)

month-name

the month that the schedule executes, by name

Values

january, february, march, april, may, june, july, august, september, october, november, december (maximum 12 month-names)

all

specifies all months

script-policy

Syntax

script-policy policy-name [owner policy-owner]

no script-policy

Context

config>system>cron>schedule

Description

This command specifies the script policy associated with the script to be run by the CRON schedule. The script policy must have already been created in the config>system>script-control context.

Default

no script-policy

Parameters

policy-name

the name of the script policy associated with the needed script

policy-owner

the name of the owner that, combined with the script policy name, is associated with the needed script

type

Syntax

type schedule-type

Context

config>system>cron>schedule

Description

This command configures how the schedule runs (periodically, on a specified date or dates, or one time only).

Default

periodic

Parameters

schedule-type

the type of schedule

Values

periodic — specifies that the schedule runs at a specified interval. The interval value must be configured.

calendar — specifies that the schedule runs based on a calendar. The month, weekday or day-of-month, hour, and minute must be configured.

oneshot — specifies that the schedule runs one time only, then enters a shutdown state. The month, weekday or day-of-month, hour, and minute must be configured.

weekday

Syntax

weekday {weekday-number [..weekday-number] | day-name [..day-name] | all}

no weekday

Context

config>system>cron>schedule

Description

This command specifies on which days of the week the schedule executes. Multiple days of the week can be specified. If multiple days are configured, each of them triggers the schedule. If a weekday is configured without configuring month, hour, and minute, the schedule does not execute.

Using the weekday command as well as the day-of-month command may cause the schedule to run twice in a week. For example, if today is Monday, January 1, and month is set to January, weekday is set to Tuesday, and day-of-month is set to the 5th day of the month, the schedule runs on Tuesday (January 2) and on Friday (January 5).

The no form of this command removes the specified weekday or all configured weekdays.

Default

no weekday

Parameters

weekday-number

the day of the week that the schedule executes, by number

Values

1 to 7 (maximum 7 weekday-numbers)

day-name

the day of the week that the schedule executes, by name

Values

sunday, monday, tuesday, wednesday, thursday, friday, saturday (maximum 7 day-names)

all

specifies all days of the week