Getting information about a backup policy
Information on policies becomes available for viewing after you activateCloud Backup.
After activation, the system automatically creates the following backup policies:
Default daily: Daily incremental backup with the last 15 backups retained.Default weekly: Weekly incremental backup with the last 15 backups retained.Default monthly: Monthly incremental backup with the last 15 backups retained.
- In the management console
, go to the folder your backup policy is in. - Select Cloud Backup.
- In the left-hand panel, select
Backup policies. - Select the backup policy you want to view.
- The Overview page shows the backup policy details.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
Get a list of backup policies in the default folder:
yc backup policy listResult:
+----------------------+----------------------+-----------------+---------+---------------------+---------------------+ | ID | FOLDER ID | NAME | ENABLED | CREATED AT | UPDATED AT | +----------------------+----------------------+-----------------+---------+---------------------+---------------------+ | cdgp2n2s73lg******** | b1gsm0k26v1l******** | Default daily | true | 2023-07-20 13:55:14 | 2024-08-15 08:27:41 | | cdguolnopexf******** | b1gsm0k26v1l******** | Default weekly | true | 2023-07-20 13:55:14 | 2023-09-05 16:24:05 | | cdgklelzc4pi******** | b1gsm0k26v1l******** | Default monthly | true | 2023-07-20 13:55:15 | 2024-09-02 08:40:18 | +----------------------+----------------------+-----------------+---------+---------------------+---------------------+Save
IDandNAMEof the policy you want to get information on. -
View the description of the CLI command for information about a backup policy:
yc backup policy get --help -
Get information about the backup policy by specifying its name or ID:
yc backup policy get <backup_policy_ID>Result:
id: cdgvykqerzzc******** name: Default weekly created_at: "2023-10-09T20:23:46.980915356Z" updated_at: "2023-10-09T20:23:46.978341789Z" enabled: true settings: compression: NORMAL format: AUTO multi_volume_snapshotting_enabled: true preserve_file_security_settings: true reattempts: enabled: true interval: type: SECONDS count: "30" max_attempts: "30" ...
For more information about the command, see the CLI reference.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To get information about a backup policy using Terraform:
-
Add the
dataandoutputsections to the Terraform configuration file:data "yandex_backup_policy" "my_policy" { policy_id = "<policy_ID>" } output "my_policy_schedule" { value = data.yandex_backup_policy.my_policy.scheduling }Where:
data "yandex_backup_policy": Description of the backup policy as a data source:policy_id: Backup policy ID. You can also use thenameparameter representing the name of the backup policy.
output "my_policy_schedule": Output variable that contains information about the backup policy schedule:value: Returned value.
You can replace
schedulingwith any other policy parameter to get the information you need.For more information about the
yandex_backup_policydata source parameters, see the relevant provider documentation. -
Create resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will create the required resources and display the output variable values in the terminal. To check the results, run:
terraform outputResult:
my_policy_name = toset([ { "backup_sets" = toset([ { "execute_by_interval" = 0 "execute_by_time" = toset([ { "include_last_day_of_month" = false "monthdays" = tolist([]) "months" = tolist([]) "repeat_at" = tolist([ "01:45", ... "enabled" = true "max_parallel_backups" = 2 "random_max_delay" = "30m" "scheme" = "ALWAYS_INCREMENTAL" "weekly_backup_day" = "MONDAY" ... -
To get detailed information about a backup policy, use the get REST API method for the Policy resource or the PolicyService/Get gRPC API call.