Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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:

    • One or more C Series Controllers running the Juniper Networks Session and Resource Control (SRC) software
    • SRC Release 4.3.0 or later

    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:

    • Repeat with no end date
    • Repeat until the defined end date

    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:

    • Scheduled period–Start and end dates along with a time period within which the action is repeated, where the end date and time period are optional
    • Except period–Start and end dates along with a time period within which the action is not performed, where the time period is optional
    • Duration–Period of the action, which can also be more than a week

    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:

    • Activate a service from 4-Jun-2012, 2:00 PM to 27-Aug-2012, 1:00 PM.
    • Repeat the service for 120 minutes every third Monday between 2:00 PM to 4:00 PM.
    • Exclude the activation from 15-Jul-2012, 8:00 AM to 20-Jul-2012, 8:00 AM.
    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:

    • You cannot activate the Video-Gold service on 16-Jul-2012 because it falls within the configured exclusion period.
    • You cannot activate the Video-Gold service on 27-Aug-2012 because the scheduled activation time falls beyond the configured end time of the recurrence pattern.
    [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:

    • Action type
    • From and To period
    • From and To exclusion period

    Published: 2014-06-06