All Products
Search
Document Center

Serverless App Engine:Create a scheduled start and stop rule

Last Updated:Nov 28, 2025

To save costs, you can create scheduled start and stop rules for your applications. Stopped applications do not incur fees for computing resources.

1. Grant SAE full permissions to OOS

The scheduled start and stop feature for applications depends on CloudOps Orchestration Service (OOS). First, create an OOSServiceRole RAM role and grant the AliyunSAEFullAccess permission to the role to manage SAE.

  1. Log on to the RAM console as a RAM user who has administrative rights.

  2. In the left-side navigation pane, choose Identities > Roles.

  3. On the Roles page, click Create Role.

    image

  4. On the Create Role page, set Principal Type to Cloud Service. Then, in the Principal Name field, search for OOS, select CloudOps Orchestration Service, and click OK.

  5. In the dialog box that appears, enter OOSServiceRole for Role Name. On the Permissions tab, click Grant Permission. In the Policy area, search for and select the AliyunSAEFullAccess permission, and then click Grant permissions.

2. Manage scheduled start and stop rules

  1. In SAE Namespaces, select a destination region from the drop-down list at the top of the page. Then, click the name of the target Namespace to open its details page.

  2. In the navigation pane on the left, click Scheduled Start and Stop Rules. On the Scheduled Start and Stop Rules page, click Create Scheduled Start and Stop Rule.

  3. In the Create Scheduled Start and Stop Rule panel, configure the parameters and click OK.

    Configuration Item

    Description

    Rule Name

    A custom name for the scheduled start and stop rule.

    Trigger

    • Batch Start Applications: Starts the selected applications in the current namespace in batches.

    • Batch Stop Applications: Stops the selected applications in the current namespace in batches.

    Frequency

    • Execute Only Once: The rule is executed once at the specified date and time and does not repeat.

    • Scheduled Execution: The rule is executed periodically at the specified date and time. Use a Crontab expression to define the execution time. The following list describes the value ranges for each field.

      • Minute: [0, 59].

      • Hour: [0, 23]. 0 indicates midnight.

      • Day of month: [1, 31].

      • Month: [1, 12] or [JAN, DEC]. This field cannot be modified.

      • Day of week: [1, 7] or [Sun, Sat]. 1 indicates Sunday and 7 indicates Saturday. For example, to set the trigger time to Tuesday, Thursday, and Saturday, enter 3,5,7 or Tue,Thu,Sat.

      Note

      [1, 7] indicates the value range. If you enter 1,7 in the Day of week field, the rule is triggered only on Sunday and Saturday.

    Pre-execution Notification Configuration

    Configure a DingTalk chatbot webhook URL. SAE sends a notification to the specified DingTalk chatbot before each scheduled task is executed. This lets you promptly obtain information about O&M actions. The custom keyword for the DingTalk chatbot must be set to SAE. For more information, see Obtain the webhook URL of a DingTalk chatbot.

    Triggered Applications

    • Start/Stop All Applications: Starts or stops all applications in the target namespace. Before each scheduled task is executed, the system automatically scans the latest application list and then performs the start or stop operation.

    • Start/Stop Some Applications: After you select Start/Stop Some Applications, select the type of applications on which you want to perform start or stop operations from the drop-down list. Then, select the check boxes next to the names of the target applications.

    After the rule is created, you can view it on the Scheduled Start and Stop Rules page. You can also Disable, Edit, and Delete existing rules.

How to write a Crontab expression

Crontab expressions allow you to define more flexible scheduled start and stop rules, trigger times, and recurrence patterns. The following table provides examples of Crontab expressions.

Meaning

Instructions

Crontab expression

At 22:30 from Monday to Friday

30 (minute) 22 (hour) ? (day-of-month) * (month) 2,3,4,5,6 (day-of-week)

30 22 ? * 2,3,4,5,6

At 00:00 on the 5th, 15th, and 25th day of each month

0 minute 0 hour 5,15,25 day * month ? week

0 0 5,15,25 * ?

When you use Crontab expressions, note the following:

  • You can specify the trigger time by either day of month or day of week, but not both. If you specify a value for one of these fields, you must use the wildcard character ? for the other. The wildcard character indicates that no specific value is set. For example, if you want a rule to run on the 1st and 2nd day of each month, you must set the day of week field to ?.

  • You must use half-width characters in a Crontab expression, such as the asterisk (*) and question mark (?).

  • Separate multiple values with commas (,).

  • Use a hyphen (-) to specify a range of values. For example, 1-5 in the day of month field indicates the first to the fifth day.

  • For the day of week field, 1 represents Sunday, 2 represents Monday, and so on, with 7 representing Saturday. For example, 2-6 represents Monday to Friday.