Import a custom calendar
This topic describes how to import, configure, and modify a custom calendar for a task scheduling instance.
Use the custom calendar feature to run jobs only on specific days, such as workdays or financial trading days, or to pause them during events like major promotions. This helps you meet specific business requirements.
Procedure
-
Import a custom calendar
Go to the OpenAPI Explorer and configure the parameters to import a calendar.
On the debugging page for the ImportCalendar API, set the region to China (Shanghai). For Name, enter
workday. For Year, enter2024. For Months, enter a JSON array that contains the workdays for each month, for example,[{"month":1,"days":[3,4,5,6,9,10,11,12,13,...]}]. For ClusterId, enter the corresponding cluster ID, and then click Submit. -
Assign the calendar to a job
-
After importing the custom calendar, log in to the XXL-JOB console. Select a region from the top navigation bar, and then go to your XXL-JOB instance.
-
In the left-side navigation pane, click Task Management.
-
When you create or edit a job, in the Timing configuration step, expand Advanced Configuration. Under specify calendar, select the calendar you imported.
-
-
Modify a calendar
To modify a calendar, re-import it. A new calendar with the same name (Name) overwrites the existing one.