# Schedule Function

## 1. Function Overview

Scheduling functionality is used to execute specific processes when any particular time or event occurs.
This functionality enables the following types of actions using a Yamaha network switch.

- Apply QoS to a specific VLAN only during a specific period.

- Supplies PoE power to wireless LAN access points only during the specified period.

- Periodically saves “tech-support” information in microSD memory.

## 2. Definition of Terms Used

Trigger

General term for conditions/criteria, such as that the internal clock time matches a specified time or that a specific event occurs.

Time Trigger

Condition that the internal clock time matches a specified time.

Event Trigger

Condition that a specific event occurs.

Action

Action executed when a trigger is activated.

## 3. Function Details

Scheduling functionality involves specifying “triggers” and actions, which are the two parameter settings for executing specific process “actions” when a particular specified time or event trigger occurs.

### 3.1. Time Trigger

Time triggers can be specified in terms of year, month, day, hour, minute, and second.
Time triggers are specified using the schedule command.
Available setting parameters are indicated below.

Type | Specification method | Setting value example
--- | --- | ---
Date | Month 1-12 | One specific month (such as only December) | 12
Multiple specific months (such as only January and February) | 1,2
Range from specific month to December (such as February to December) | 2-
Range from specific month to specific month (such as February to July) | 2-7
Range from January to specific month (such as January to July) | -7
Every month | *
Day 1-31 | One specific day (such as day 1 only) | 1
Multiple specific days (such as days 1 and 2 only) | 1,2
Range from specific day to last day (such as day 2 to month-end) | 2-
Range from specific day to specific day (such as days 2 to 7) | 2-7
Range from day 1 to specific day (such as days 1 to 7) | -7
Every day | *
Specific day-of-week only (such as Monday only) | mon
Multiple specific days of the week only (such as Saturday and Sundays only) | sat,sun
Range from specific day-of-week to specific day-of-week (such as Monday to Friday) | mon-fri
Range from Sunday to specific day-of-the-week (such as Sunday to Friday) | -fri
Hours, minutes, seconds | Hours 0-23 | Specific hour only (such as 23:00 only) | 23
Multiple specific hours only (such as 01:00 and 22:00 only) | 1,22
Range from specific hour to 23:00 (such as 02:00 to 23:00) | 2-
Range from specific hour to specific hour (such as 02:00 to 21:00) | 2-21
Range from hour 00:00 to specific hour (such as 00:00 to 21:00) | -21
Each hour | *
Minutes 0-59 | One specific minute only (such as minute 59 only) | 59
Multiple specific minutes only (such as minutes 1 and 50 only) | 1,50
Range from specific minute to minute 59 (such as minutes 2 to 59) | 2-
Range from specific minute to specific minute (such as minutes 2 to 50) | 2-50
Range from minute 0 to specific minute (such as minutes 0 to 50) | -50
Each minute | *
Seconds 0-59 | One specific second only (such as second 59 only) This setting may be omitted. | 59

### 3.2. Event Trigger

Either of the following events can be specified as an event trigger.
Time triggers are specified using the schedule command.
Events that can be specified are indicated below.

Type | Description
--- | ---
startup | Action is executed when startup occurs.
sd-attached | Action is executed when a microSD card is inserted.

### 3.3. Action

Processes executed when a time trigger or event trigger is activated are called actions.
To specify actions, use the schedule template command to switch to the schedule template mode and then specify the action using the cli-command or script command.
The following two actions are available.

Action | Command for settings | Description
--- | --- | ---
Executes specified command | cli-command command | Executes the specified commands in ascending order of ID numbers.
Executes Specified Script | script command | Executes the character strings in the first 100 lines of the specified file /(model name)/schedule/script.txt in external memory (microSD) as a command.

## 4. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operating mode | Commands | Description
--- | --- | ---
Global configuration mode | schedule | Specifies a schedule template ID that specifies the trigger and defines the action.
schedule template | Specifies the schedule template ID and switches to the schedule template mode.
Schedule template mode | description | Specifies description of the schedule template.
action | Enables/disables the schedule template. Use disable to temporarily disable schedule function.
cli-command | Defines command executed when trigger is activated.
script | Enables execution of commands indicated in specified file in external memory.

## 5. Setting Examples

### 5.1. Supplying PoE power to wireless LAN access points only during specified hours

Supply PoE power to wireless LAN access points connected to port1.1 and port1.2 on weekdays only between 8:00 and 17:00.

    Yamaha#
    Yamaha# configure terminal
    Yamaha(config)# schedule 1 time */mon-fri 8:00:00 1
    Yamaha(config)# schedule template 1
    Yamaha(config-schedule)# cli-command 1 configure terminal
    Yamaha(config-schedule)# cli-command 2 interface port1.1-2
    Yamaha(config-schedule)# cli-command 3 power-inline enable
    Yamaha(config-schedule)# exit
    Yamaha(config)#
    Yamaha(config)# schedule 2 time */mon-fri 17:00:00 2
    Yamaha(config)# schedule template 2
    Yamaha(config-schedule)# cli-command 1 configure terminal
    Yamaha(config-schedule)# cli-command 2 interface port1.1-2
    Yamaha(config-schedule)# cli-command 3 power-inline disable
    Yamaha(config-schedule)# end
    Yamaha#

### 5.2. Obtaining internal information when microSD memory is inserted

Automatically saves tech-support in microSD memory when microSD card is inserted.

    Yamaha#
    Yamaha# configure terminal
    Yamaha(config)# schedule 1 event sd-attached 1
    Yamaha(config)# schedule template 1
    Yamaha(config-schedule)# cli-command 1 copy tech-support sd
    Yamaha(config-schedule)# end
    Yamaha#

## 6. Unavailable Commands

The following commands cannot be executed for the schedule function.

- backup system

- baudrate select

- boot prioritize sd / no boot prioritize sd

- certificate user

- Commands that begin with “clock”

- cold start

- copy radius-server local

- crypto pki generate ca / no crypto pki generate ca

- disable

- enable password

- exit

- firmware-update execute

- firmware-update sd execute

- logout

- Commands that begin with “ntpdate” or “no ntpdate”

- password / no password

- password-encryption / no password-encryption

- ping /ping6

- quit

- reload

- remote-login

- restart

- restore system

- schedule / no schedule

- schedule template / no schedule template

- Commands that begin with “show”

- ssh

- ssh-server host key generate

- Commands that begin with “stack” or “no stack”

- startup-config select / no startup-config select

- telnet

- traceroute / traceroute6

## 7. SYSLOG

The schedule function outputs the following SYSLOG messages.

Level | Output | Description
--- | --- | ---
Info | [SCHEDULE]:inf:ID:X command is done | The schedule template ID:X command was executed when the trigger was activated.
[SCHEDULE]:inf:ID:X script is done | The schedule template ID:X script was executed when the trigger was activated.
Error | [SCHEDULE]:err:ID:X cmd[ID][COMMAND] is prohibited to execute | Execution of the prohibited command COMMAND in schedule template ID:X was suppressed.
[SCHEDULE]:err:ID:X cmd[ID][COMMAND] is failed to execute | Command failed in schedule template ID:X due to invalid command format or inappropriate parameter setting.
[SCHEDULE]:err:ID:X microSD is not mounted | Script execution failed at schedule template ID:X because microSD was not inserted.
[SCHEDULE]:err:ID:X failed to get the schedule forlder path | Script execution failed at schedule template ID:X because the expected directory containing the script was not found.
[SCHEDULE]:err:ID:X script is not found | Script execution failed at schedule template ID:X because the script file was not found.
[SCHEDULE]:err:ID:X failed to add action to queue | Action failed at schedule template ID:X because action was discarded due to the many actions waiting for execution in the queue.

## 8. Points of Caution

- When actions are executed, the cli-command executes actions in ascending ID number order.

- When actions are executed, even if a command specified by the cli-command results in an execution error, the remaining commands are executed.

- If both a cli-command and script command are specified in the same schedule template, then the script command is executed and the cli-command is not executed.

- If multiple triggers are activated simultaneously, then actions are executed in ascending order of schedule template ID number.

- The following precautions apply for devices that include a stack.

  - A “startup” event trigger was not activated in stack member switches.

  - A “sd-attached” event trigger was not activated in stack member switches.

- The trigger is not activated if a stack is enabled and is in the standalone state.

- If the trigger activation time elapses due to the time setting being set manually by the clock set command or being changed by NTP, then any existing triggers scheduled to be activated within 59 seconds of when the current time setting was changed will be activated.

- If the trigger activation time was changed backward manually by the clock set command or by NTP, then the time triggers are checked again starting from the time to which it was set back.

- This function can be used to periodically save the configuration, but periodic rewriting will consume ROM capacity more quickly. ROM failures due to frequent rewriting are not warranted for free repairs, even if they occur during the warranty period.

## 9. Related Documentation

- None

Search result
No more search results.
There are no topics that match your search query.