Example: Configuring the Scheduler to Activate Services with a Weekly Recurrence Pattern for a Specified Time Period (SRC CLI)

This example shows how to activate a service with a weekly recurrence pattern.

Requirements

This example uses the following hardware and software components:

No special configuration beyond device initialization is required before you can configure this feature.

Overview

You can schedule services with a weekly recurrence pattern that uses the following ranges of occurrence:

A weekly recurrence pattern defines the number of weeks after which the action for the scheduled service is to be repeated based on the following settings:

You can set the action for the scheduled service to be activated or deactivated for the specified weekly recurrence pattern.

Configuration

CLI Quick Configuration

To quickly configure the global parameter, copy the following commands into a text editor, and modify them as needed; then load the configuration from the file

[edit] set services global schedule videoSchedule event weeklyrecur action activate_video service Video-Gold type activate set services global schedule videoSchedule event weeklyrecur from day-of-month 4 set services global schedule videoSchedule event weeklyrecur from effective 120 set services global schedule videoSchedule event weeklyrecur from hour 14 set services global schedule videoSchedule event weeklyrecur from minute 0 set services global schedule videoSchedule event weeklyrecur from month 6 set services global schedule videoSchedule event weeklyrecur from day-of-week 1 set services global schedule videoSchedule event weeklyrecur from year 2012 set services global schedule videoSchedule event weeklyrecur to day-of-month 27 set services global schedule videoSchedule event weeklyrecur to hour 13 set services global schedule videoSchedule event weeklyrecur to minute 0 set services global schedule videoSchedule event weeklyrecur to month 8 set services global schedule videoSchedule event weeklyrecur to year 2012 set services global schedule videoSchedule event weeklyrecur except exclude from day-of-month 15 set services global schedule videoSchedule event weeklyrecur except exclude from hour 8 set services global schedule videoSchedule event weeklyrecur except exclude from minute 0 set services global schedule videoSchedule event weeklyrecur except exclude from month 7 set services global schedule videoSchedule event weeklyrecur except exclude from year 2012 set services global schedule videoSchedule event weeklyrecur except exclude to day-of-month 20 set services global schedule videoSchedule event weeklyrecur except exclude to hour 8 set services global schedule videoSchedule event weeklyrecur except exclude to minute 0 set services global schedule videoSchedule event weeklyrecur except exclude to month 7 set services global schedule videoSchedule event weeklyrecur except exclude to year 2012

Step-by-Step Procedure

To activate the Video-Gold service for subscribers with the following recurrence pattern:

  1. From configuration mode, access the configuration statement that configures the service schedule in the global configuration. Enter a unique name for the service schedule—for example, videoSchedule.
    user@host# edit services global schedule videoSchedule
  2. Configure the schedule entry. Enter a name for the schedule entry—for example, weeklyrecur.
    [edit services global schedule videoSchedule] user@host# edit event weeklyrecur
  3. Specify activate as the action for the Video-Gold service.
    [edit services global schedule videoSchedule event weeklyrecur] user@host# set action activate_video service Video-Gold type activate
  4. Configure the weekly schedule.
    [edit services global schedule videoSchedule event weeklyrecur] user@host# edit from [edit services global schedule videoSchedule event weeklyrecur from]user@host# set day-of-month 4 user@host# set effective 120 user@host# set hour 14 user@host# set minute 0user@host# set month 6 user@host# set day-of-week 1 user@host# set year 2012user@host# up[edit services global schedule videoSchedule event weeklyrecur] user@host# edit to [edit services global schedule videoSchedule event weeklyrecur to]user@host# set day-of-month 27 user@host# set hour 13 user@host# set minute 0 user@host# set month 8 user@host# set year 2012user@host# up[edit services global schedule videoSchedule event weeklyrecur]
  5. Configure the exclusion. Enter a name for the exclusion—for example, exclude.
    user@host# edit except [edit services global schedule videoSchedule event weeklyrecur except]user@host# set exclude from day-of-month 15 user@host# set exclude from hour 8 user@host# set exclude from minute 0 user@host# set exclude from month 7 user@host# set exclude from year 2012[edit services global schedule videoSchedule event weeklyrecur except]user@host# set exclude to day-of-month 20 user@host# set exclude to hour 8 user@host# set exclude to minute 0 user@host# set exclude to month 7 user@host# set exclude to year 2012[edit services global schedule videoSchedule event weeklyrecur except]

    Note: For the same scenario, if you want to repeat the service every third Wednesday instead of every third Monday, then the scheduler does not start on 4-Jun-2012 (even if it is the configured start date). Instead, the scheduler’s first event falls on the first Wednesday—that is, 6-Jun-2012 (because day-of-week has more precedence than day-of-month).

Results

From configuration mode, confirm your configuration by entering the show services global schedule videoschedule command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

This configuration activates the Video-Gold service on 4-Jun-2012, 25-Jun-2012, and 6-Aug-2012 with the following exceptions:

[edit]user@host# show services global schedule videoschedule
event weeklyrecur {action activate_video {service Video_Gold;type activate;}except exclude {from {day-of-month 15;hour 8;minute 0;month 7;year 2012;}to {day-of-month 20;hour 8;minute 0;month 7;year 2012;}}from {day-of-month 4;day-of-week 1;effective 120;hour 14;minute 0;month 6;year 2012;}to {day-of-month 27;hour 13;minute 0;month 8;year 2012;}}

If you are done configuring the device, enter commit from configuration mode.

Verification

To confirm that the configuration is working properly, perform this task:

Verifying That the Service is Configured in a Weekly Recurrence Pattern

Purpose

Verify that the service is configured in a weekly recurrence pattern.

Action

From operational mode, enter the show services global schedule videoschedule command to display the output of the configured weekly recurrence pattern.

Meaning

The output displays information about the weekly recurrence pattern configured on the system. Verify the following information:

Related Documentation