Disabling and enabling a disk snapshot schedule
Disabling a schedule
To disable an automatic disk snapshot schedule:
- In the management console
, select the folder where the schedule is located. - Select Compute Cloud.
- In the left-hand panel, select
Snapshots. - Go to the Snapshot schedules tab.
- Next to the schedule you want to disable, click
and select Stop. - Confirm disabling the schedule.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI commands for managing schedules:
yc compute snapshot-schedule --help yc compute snapshot-schedule disable --help
-
Get a list of schedules in the default folder:
yc compute snapshot-schedule list --format yaml
Result:
- id: fc852cvb1ipd5******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T13:25:02Z" name: sched-1 status: ACTIVE schedule_policy: start_at: "2022-10-01T00:00:00Z" expression: 59 14 */1 * * snapshot_spec: {} - id: fc89n1j15l7f******** folder_id: e1ea8s8l71li******** created_at: "2022-09-27T16:04:13Z" name: sched-2 status: ACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 0 */1 * * * retention_period: 3600s snapshot_spec: {} - id: fc8bplhqmh2b******** folder_id: b8gauskl78li******** created_at: "2022-10-03T13:28:01Z" name: sched-3 description: Daily labels: machine: file-server status: ACTIVE schedule_policy: start_at: "2022-12-31T19:04:05Z" expression: 10 19 ? * * snapshot_count: "7" snapshot_spec: {}
-
Disable the selected schedule:
yc compute snapshot-schedule disable <name_or_ID_of_the_schedule>
Result:
done (3s) id: fc8e52mvchb2******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T09:15:28Z" name: sched-1 status: INACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 36 14 */1 * * snapshot_count: "3" snapshot_spec: {}
- Get the list of schedules using the list REST API method for the SnapshotSchedule resource or the SnapshotScheduleService/List gRPC API call.
- Disable a snapshot schedule using the disable REST API method for the
SnapshotSchedule
resource or the SnapshotScheduleService/Disable gRPC API call.
The schedule status will change to INACTIVE
: disk snapshots will not be created or deleted.
All snapshot creation and deletion operations that started prior to disabling the schedule will be completed.
Enabling a schedule
To enable an automatic disk snapshot schedule:
- In the management console
, select the folder where the schedule is located. - Select Compute Cloud.
- In the left-hand panel, select
Snapshots. - Go to the Snapshot schedules tab.
- Next to the schedule you want to enable, click
and select Start.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI commands for managing schedules:
yc compute snapshot-schedule --help yc compute snapshot-schedule enable --help
-
Get a list of schedules in the default folder:
yc compute snapshot-schedule list --format yaml
Result:
- id: fc852cvb1ipd5******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T13:25:02Z" name: sched-1 status: ACTIVE schedule_policy: start_at: "2022-10-01T00:00:00Z" expression: 59 14 */1 * * snapshot_spec: {} - id: fc89n1j15l7f******** folder_id: e1ea8s8l71li******** created_at: "2022-09-27T16:04:13Z" name: sched-2 status: ACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 0 */1 * * * retention_period: 3600s snapshot_spec: {} - id: fc8bplhqmh2b******** folder_id: b8gauskl78li******** created_at: "2022-10-03T13:28:01Z" name: sched-3 description: Daily labels: machine: file-server status: ACTIVE schedule_policy: start_at: "2022-12-31T19:04:05Z" expression: 10 19 ? * * snapshot_count: "7" snapshot_spec: {}
-
Enable the selected schedule:
yc compute snapshot-schedule enable <name_or_ID_of_the_schedule>
Result:
done (3s) id: fc8e52mvchb2******** folder_id: e1ea8s8l71li******** created_at: "2022-09-28T09:15:28Z" name: sched-1 status: ACTIVE schedule_policy: start_at: "1970-01-01T00:00:00Z" expression: 36 14 */1 * * snapshot_count: "3" snapshot_spec: {}
- Get the list of schedules using the list REST API method for the SnapshotSchedule resource or the SnapshotScheduleService/List gRPC API call.
- Enable a snapshot schedule using the enable REST API method for the
SnapshotSchedule
resource or the SnapshotScheduleService/Enable gRPC API call.
The schedule status will change to ACTIVE
: new disk snapshots will be created, old ones deleted (if the corresponding parameter of snapshot retention is selected).