Scheduling Cluster Activity
Magpie clusters can be scheduled to start, stop, or restart at fixed times with cluster schedules. Adding a schedule requires write permission or above on the cluster. The schedule runs its action as a user who also needs write permission; by default this is the creator, and userName names another account such as a service account.
A schedule has one of three actions: Start, Stop, or Restart. Start is skipped if the cluster is already running, and Stop and Restart are skipped if it is already stopped. A skipped action is recorded as a successful run. An action that fires while the cluster is still starting or stopping fails, so leave enough time between a start and a stop for the cluster to come up.
Example 1: a recurring schedule
The following pair keeps main_cluster up during working hours on weekdays, in New York time:
alter cluster main_cluster add schedule {
"name": "start_weekdays",
"expression": "0 0 7 ? * MON-FRI",
"clusterAction": "Start",
"timeZone": "America/New_York"
};
alter cluster main_cluster add schedule {
"name": "stop_weekdays",
"expression": "0 0 19 ? * MON-FRI",
"clusterAction": "Stop",
"timeZone": "America/New_York"
};
expression sets when the schedule fires and timeZone sets the clock it is read against; a daylight-saving-aware zone keeps the schedule at the same local time across clock changes. Cron Expressions and Time Zones explains both. New and changed schedules take effect within a minute, and the cluster schedule specification describes every field.
Example 2: a schedule active for a fixed period
startTime and endTime bound a schedule to a period. The expression still decides when it fires inside that period, and it never fires outside it. The following schedule stops main_cluster at 22:00 UTC every night, but only for two weeks:
alter cluster main_cluster add schedule {
"name": "nightly_stop_load_test",
"description": "Nightly stop for the two-week load test",
"expression": "0 0 22 * * ?",
"clusterAction": "Stop",
"timeZone": "UTC",
"startTime": "2027-03-01T00:00:00Z",
"endTime": "2027-03-15T00:00:00Z"
}
A bounded schedule suits a temporary need with a known end date, such as a project or a trial: it can be added in advance, begins without anyone acting, and stops itself without cleanup. The schedule stays defined after its end time and can be revived by altering endTime. A schedule whose end time has already passed cannot be added.
Managing schedules
list schedules for cluster main_cluster;
describe cluster schedule main_cluster.stop_weekdays;
alter cluster schedule main_cluster.stop_weekdays set expression "0 0 20 ? * MON-FRI";
alter cluster main_cluster drop schedule stop_weekdays;
Describing the cluster also lists its schedules on the Schedules tab:

To move every schedule owned by one user to another, use reassign cluster schedules.
What happens when a schedule runs
Each run opens a session as the schedule's user and records a cluster action named <cluster>.<schedule>, so the start or stop appears in cluster history and activity history under that user. If the cluster has notification subscriptions, every subscriber is emailed whether the action succeeded or failed.