Cron is a time-based job scheduler for Unix-like operating systems. You can use Cron to run scheduled jobs, which can be commands or scripts, at fixed times or date intervals.
-
Professional Edition applications support second-level Cron scheduling.
-
Basic Edition applications do not support second-level Cron scheduling. Use
second_delayinstead.
Cron expression
A Cron expression uses the following format: second minute hour day-of-month month day-of-week [year]
The following table describes common Cron expressions.
|
Cron expression |
Description |
|
0 */1 * * * ? |
Triggers every minute. |
|
0 0 5-15 * * ? |
Triggers on the hour from 05:00 to 15:00 every day. |
|
0 0/3 * * * ? |
Triggers every 3 minutes. |
|
0 0-5 14 * * ? |
Triggers every minute from 14:00 to 14:05 every day. |
|
0 0/5 14 * * ? |
Triggers every 5 minutes from 14:00 to 14:55 every day. |
|
0 0/5 14,18 * * ? |
Triggers every 5 minutes from 14:00 to 14:55 and from 18:00 to 18:55 every day. |
|
0 0/30 9-17 * * ? |
Triggers every 30 minutes from 09:00 to 17:00 every day. |
|
0 0 10,14,16 * * ? |
Triggers at 10:00, 14:00, and 16:00 every day. |
|
0 0 12 ? * WED |
Triggers at 12:00 every Wednesday. |
|
0 0 17 ? * TUES,THUR,SAT |
Triggers at 17:00 every Tuesday, Thursday, and Saturday. |
|
0 10,44 14 ? 3 WED |
Triggers at 14:10 and 14:44 every Wednesday in March. |
|
0 15 10 ? * MON-FRI |
Triggers at 10:15 every day from Monday to Friday. |
|
0 0 23 L * ? |
Triggers at 23:00 on the last day of every month. |
|
0 15 10 L * ? |
Triggers at 10:15 on the last day of every month. |
|
0 15 10 ? * 6L |
Triggers at 10:15 on the last Friday of every month. |
|
0 15 10 * * ? 2005 |
Triggers at 10:15 every day in 2005. |
|
0 15 10 ? * 6L 2002-2005 |
Triggers at 10:15 on the last Friday of every month from 2002 to 2005. |
|
0 15 10 ? * 6#3 |
Triggers at 10:15 on the third Friday of every month. |
Example of Cron scheduling configuration
You can use Cron scheduling when you create a job. For the detailed procedure, see Create a job. This section describes only how to configure Cron scheduling for a job.
-
Go to the Schedule Configuration tab. For more information, see Create a job.
-
On the Schedule Configuration tab of the Create Task configuration wizard, set the scheduling parameters, and then click Next.
-
From the list to the right of Time Type, select Cron.
-
Set the Cron Expression.
If the scheduling rule is simple, we recommend that you use the generation tool. The following steps describe how to generate a Cron expression by using the tool. If the rule is complex and the tool cannot generate it, enter a Cron expression manually. For examples, see Cron expression.
-
Click Use Generator.
-
In the dialog box that appears, select rules such as the execution cycle and the time. For example, to run the job at 03:00 every day, set the execution cycle to Every 1 day. Then, use the scroll selector to set the hour, minute, and second of the execution time to 03:00:00, and click OK to generate the Cron expression.
-
Click Validate Cron to view the last five trigger times of the rule. For the generated Cron expression
0 0 3 * * ?, the Last 5 Trigger Times list appears. Verify that the trigger times meet your expectations, and then click OK.
-
-
Optional: In the Advanced Configuration section, set Time Offset and Time Zone.
If you set Time type to cron, you can configure advanced settings. The following table describes the advanced settings for a job.
Parameter
Description
Time offset
The offset between the timestamp of the data to be processed and the time when the job is triggered. You can obtain the offset value from the context when SchedulerX runs a job.
Time zone
Select the time zone of a country or region or select a GMT time zone based on your business requirements.
-