how to to Restart the Databricks Cluster at the specific time either using script or Job manager

Viewed 13

Command for restart is available but not have a option at specific time. databricks clusters restart --cluster-id <>

1 Answers

You can run the below command either using a script or in a Databricks Notebook (using the %sh magic command):

curl \
  -X POST \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{"cluster_id": "<CLUSTER_ID>"}' \
  https://<URL>/api/2.0/clusters/restart

From here, you can schedule the script with a tool like cron or the Databricks Notebook with a Databricks Job.

Related