Creating a Cron Expression Schedule

A cron expression is a string of five fields separated by a blank space.

Enter the cron expression in the following format:

<minute> <hour> <days of month> <months> <days of week>

Following are the valid field values that you can use in the cron expression:

  • <minute>: 0–59
  • <hour>: 0–23
  • <days of month>: 1–31
  • <months>: 1–12 (for January to December)
  • <days of week>: 1–7 (for Monday to Sunday)

For example, to run the schedule at 23:00 on the 15th day of any month, enter this expression: 0 23 15 * *

A field can also have the following special characters:

  • * : Represents any value.
  • , : Separator for more than one value. For example, for <days of week>, 2,3 represents Tuesday and Wednesday.
  • - : Range of values. For example, for <days of week>, 1-3 represents Monday through Wednesday.
  • / : Step values. For example, for <minute>, */30 represents every 30 minutes.
Note

You can't create a schedule that triggers at an interval of less than 30 minutes. Only intervals of 30 minutes or more are allowed.

For example, you can create a schedule with the expression */30 * 15 * * to run the schedule every 30 minutes on the 15th day of any month. You can't, however, define a schedule with */15 * 15 * *.

Use the following procedure to create a schedule by writing a cron expression.

    1. On the Applications list page, select the name of the application that contains the tasks that you want to schedule. If you need help finding the list page or the application, see Listing Applications
    2. On the application details page, select Schedules and then select Create schedule.
    3. On the Create schedule page, enter a name and a description (optional).

      The identifier is a system-generated value based on the name. You can change the value, but after you create and save the schedule, you can't update the identifier.

    4. From the Time zone menu, select a time zone for this schedule.
    5. From the Frequency menu, select Cron expression.
    6. Enter the expression and select Validate.

      If validation is successful, proceed to the next step. If not, revise the expression.

    7. Select Create.
  • Use the oci data-integration schedule create command, required parameters, and the complex type parameter to create a schedule:

    oci data-integration schedule create [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • Run the CreateSchedule operation with the appropriate frequency model to create a schedule.