gcloud alpha compute resource-policies create-backup-schedule

NAME
gcloud alpha compute resource-policies create-backup-schedule - create a Google Compute Engine Backup Schedule Resource Policy
SYNOPSIS
gcloud alpha compute resource-policies create-backup-schedule NAME --max-retention-days=MAX_RETENTION_DAYS (--weekly-schedule-from-file=WEEKLY_CYCLE_FROM_FILE     | --start-time=START_TIME (--daily-schedule | --hourly-schedule=HOURS | --weekly-schedule=WEEKLY_CYCLE)) [--description=DESCRIPTION] [--on-source-disk-delete=ON_SOURCE_DISK_DELETE] [--region=REGION] [--guest-flush --snapshot-labels=[KEY=VALUE,…] --storage-location=LOCATION] [GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) gcloud alpha compute resource-policies create-backup-schedule creates a Resource Policy which can be attached to disks and specifies a schedule for taking disk snapshots and how long these snapshots should be retained.
POSITIONAL ARGUMENTS
NAME
Name of the resource policy to operate on.
REQUIRED FLAGS
--max-retention-days=MAX_RETENTION_DAYS
Maximum number of days snapshot can be retained.
Cycle Frequency Group. Exactly one of these must be specified:
From file
--weekly-schedule-from-file=WEEKLY_CYCLE_FROM_FILE
A file which defines a weekly cadence with multiple days and start times. The format is a JSON/YAML file containing a list of objects with the following fields:

day: Day of the week with the same choices as --weekly-schedule. startTime: Start time of the snapshot schedule with the same format as --start-time.

From flags
--start-time=START_TIME
Start time for the disk snapshot schedule to start. This flag must be specified if any of the other arguments in this group are specified.
Exactly one of these must be specified:
--daily-schedule
Snapshot schedule occurs daily at START_TIME.
--hourly-schedule=HOURS
Snapshot schedule occurs every n hours starting at START_TIME.
--weekly-schedule=WEEKLY_CYCLE
Snapshot schedule occurs weekly on WEEKLY_SCHEDULE at START_TIME. WEEKLY_CYCLE must be one of: monday, tuesday, wednesday, thursday, friday, saturday, sunday.
OPTIONAL FLAGS
--description=DESCRIPTION
An optional, textual description for the backend.
--on-source-disk-delete=ON_SOURCE_DISK_DELETE
Retention behavior of automatic snapshots in the event of source disk deletion. ON_SOURCE_DISK_DELETE must be one of:
apply-retention-policy
Continue to apply the retention window to automatically-created snapshots when the source disk is deleted.
keep-auto-snapshots
Keep automatically-created snapshots when the source disk is deleted. This is the default behavior.
--region=REGION
Region of the resource policy to operate on. If not specified, you may be prompted to select a region.

To avoid prompting when this flag is omitted, you can set the compute/region property:

  $ gcloud config set compute/region REGION

A list of regions can be fetched by running:

  $ gcloud compute regions list

To unset the property, run:

  $ gcloud config unset compute/region

Alternatively, the region can be stored in the environment variable CLOUDSDK_COMPUTE_REGION.

Snapshot properties
--guest-flush
Create an application consistent snapshot by informing the OS to prepare for the snapshot process.
--snapshot-labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.

Keys must start with a lowercase character and contain only hyphens (-), underscores (_), lowercase characters, and numbers. Values must contain only hyphens (-), underscores (_), lowercase characters, and numbers.

These will be added to the disk snapshots on creation.

--storage-location=LOCATION
Google Cloud Storage location, either regional or multi-regional, where snapshot content is to be stored. If absent, a nearby regional or multi-regional location is chosen automatically.
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at https://cloud.google.com/support/.
Was this page helpful? Let us know how we did:

Send feedback about...