@theanhdo
To schedule a job to run at 8 AM every day, you should use the Scheduled trigger type rather than the Continuous trigger type. The Continuous trigger type is designed to keep a job running continuously, which is not suitable for running a job at a specific time each day.
Here’s how you can schedule a job to run at 8 AM every day using the Scheduled trigger type:
- Navigate to Workflows:
- In the Databricks workspace, go to the sidebar and click on Workflows.
- Select the Job:
- Click the job name in the Name column on the Jobs tab.
- Add a Trigger:
- In the Job details panel, click Add trigger.
- Configure the Trigger:
- In the Trigger type dropdown, select Scheduled.
- In the Schedule type dropdown, select Advanced.
- Set the Schedule:
Use the following cron expression to schedule the job to run at 8 AM every day:
0 8 * * *
Optionally, select the Show Cron Syntax checkbox to display and edit the schedule using Quartz Cron Syntax.
- Save the Configuration:
- Click Save to apply the schedule.
This configuration will ensure that your job runs at 8 AM every day.
To stop the job, you have to use rest API
You will need to create a separate job or task that stops the main job at 5 PM. This can be done using the Databricks REST API to cancel the job run.
Create a new job that uses the REST API to cancel the main job run.
Add a trigger to this new job with the following cron expression to run at 5 PM every da