< Home

if-match timer cron

Function

The if-match timer cron command sets a specific time for executing a maintenance assistant task.

The undo if-match timer cron command deletes the specific time set for executing a maintenance assistant task.

By default, no time is set for executing a maintenance assistant task.

Format

if-match timer cron seconds minutes hours days-of-month months days-of-week [ years ]

undo if-match timer cron

Parameters

Parameter Description Value

seconds

Specifies the time in seconds at which a maintenance assistant task is executed.

The value is a string in the cron format. Currently, only "*" is supported.

minutes

Specifies the time in minutes at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it ranges from 0 to 59.

hours

Specifies the time in hours at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it ranges from 0 to 23.

days-of-month

Specifies the time in dates at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it is determined by the month, which can be in the range 1 to 28, 1 to 29, 1 to 30, or 1 to 31. This parameter is exclusive to days-of-week. At least one of these two parameters has to be set to "*".

months

Specifies the time in months at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it ranges from 1 to 12.

days-of-week

Specifies the day in weeks at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it ranges from 0 to 7. Both 0 and 7 indicate Sunday. 1 to 6 indicates from Monday to Saturday. This parameter is exclusive to days-of-month. At least one of these two parameters has to be set to "*".

years

Specifies the time in years at which a maintenance assistant task is executed.

The value is a string in the cron format. If the value is an integer, it ranges from 2000 to 2099. This parameter is optional. If not specified, it indicates all years from 2000 to 2099.

Views

Maintenance assistant view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

After a user creates a maintenance assistant task, this command can be used to set a specific time for the system to automatically execute the task. The time is in the cron format of Unix/Linux.

The commonly used time format (hh:mm:ss dd-mm-yyyy) indicates only a fixed time. The cron format is more flexible. It can indicate a single time, multiple times, a time range, or a time period in a simple way. The time in the cron format is a set of valid characters: 10 digits (0 to 9) and four special characters (*, -, /, and ,). For details about how to use the cron time, see Table 1.

Table 1 Usage of the cron time

Usage Scenario

Expression

Format

Example

Specifies a time point.

time

The value is an integer and indicates a specified time.

The if-match timer cron * 0 1 2 5 3 2012 command indicates that the maintenance assistant task is executed on 1:00, Wednesday, May 2, 2012.

Specifies multiple time points.

time1,time2,time3

The value is an integer and indicates a specified time. "," is used to separate multiple time tables and no space is at both sides of ",". The sequence of times is unlimited.

The if-match timer cron * 0 1,2,3 2 3 * 2012 command indicates that the maintenance assistant task is executed on:
  • 1:00, March 2, 2012

  • 2:00, March 2, 2012

  • 3:00, March 2, 2012

Specifies an interval.

time/step

time is an integer and indicates a specified time. step indicates a specified interval. "/" is used to separate time and step, and no space is at both sides of "/".

If this parameter is specified, the system executes a command every hour in the time range according to time, time+1*step, …… ,time+n*step (n is determined by the step configuration, and the maximum value cannot exceed the value range).

The if-match timer cron * 0 0/10 * 3 * 2012 command indicates that the maintenance assistant task is executed on:
  • 0:00, March 1, 2012

  • 10:00, March 1, 2012

  • 20:00, March 1, 2012

  • 0:00, March 2, 2012

  • ……

  • 20:00, March 31, 2012

Specifies a time range.

time1-time2

The value is an integer and indicates the start time and end time of a task. "-" is between the start time and end time. No space is at both sides of "-". The value of time2 is no less than that of time1.

The value is calculated using time1, time1+1, time1+2, …… ,time2.

The if-match timer cron * 0 0-3 1 3 * 2012 command indicates that the maintenance assistant task is executed on:
  • 0:00, March 1, 2012

  • 1:00, March 1, 2012

  • 2:00, March 1, 2012

  • 3:00, March 1, 2012

Specifies a time period.

*

"*" indicates that the value of this parameter can be all possible times.

The if-match timer cron * 30 10 * 1 1 2012 command indicates that the maintenance assistant task is executed on 10:30, each Monday of January, 2012.

Specifies a time group.

The preceding parameters can be used together.

"," is used to separate times and no space is at both sides of ",".

The if-match timer cron * 0 0/10,2,4-5 1 3 * 2012 command indicates that the maintenance assistant task is executed on:
  • 0:00, March 1, 2012

  • 2:00, March 1, 2012

  • 4:00, March 1, 2012

  • 5:00, March 1, 2012

  • 10:00, March 1, 2012

  • 20:00, March 1, 2012

Pre-configuration Tasks

A maintenance assistant task has been created and the maintenance assistant task view is displayed.

Configuration Impact

If the if-match timer cron command is run more than once, the latest configuration overrides the previous ones.

Precautions

  • If you specify asterisks (*) for both the days-of-month and days-of-week parameters, all days are used.

  • The system supports the minutes as the minimum time accuracy. You need to set the second parameter to an asterisk (*). The specified maintenance assistant task can be executed once at most in a minute.

  • The maintenance assistant tasks are executed in a sequence. The time for task execution is uncertain and may be longer than the generation time for a task instance. Therefore, the start time for task execution is different from that for generating a task instance. The time specified using the if-match timer cron command is the time when a task instance is generated, but not the execution time for the task instance.

Example

# Set a maintenance assistant task to be executed on 20:00, May 4, 2012.

<sysname> system-view
[sysname] assistant task test
[sysname-assistant-task-test] if-match timer cron * 0 20 4 5 * 2012
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >