File: //snap/google-cloud-cli/396/help/man/man1/gcloud_backup-dr_backup-plans_update.1
.TH "GCLOUD_BACKUP\-DR_BACKUP\-PLANS_UPDATE" 1
.SH "NAME"
.HP
gcloud backup\-dr backup\-plans update \- update a specific backup plan
.SH "SYNOPSIS"
.HP
\f5gcloud backup\-dr backup\-plans update\fR (\fIBACKUP_PLAN\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) [\fB\-\-add\-backup\-rule\fR=[\fIPROPERTY\fR=\fIVALUE\fR,...]] [\fB\-\-async\fR] [\fB\-\-backup\-rule\fR=[\fIPROPERTY\fR=\fIVALUE\fR,...]] [\fB\-\-backup\-rules\-from\-file\fR=\fIPATH_TO_FILE\fR] [\fB\-\-description\fR=\fIDESCRIPTION\fR] [\fB\-\-remove\-backup\-rule\fR=\fIRULE\-ID\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Update a specific backup plan in the project. It can only be updated in regions
supported by the Backup and DR Service.
.SH "EXAMPLES"
To update 2 backup rules and description of an existing backup plan
\f5\fIsample\-backup\-plan\fR\fR in project \f5\fIsample\-project\fR\fR, at
location \f5\fIus\-central1\fR\fR:
run:
.RS 2m
$ gcloud backup\-dr backup\-plans update sample\-backup\-plan \e
\-\-project=sample\-project \-\-location=us\-central1 \e
\-\-backup\-rule <BACKUP\-RULE> \-\-backup\-rule <BACKUP\-RULE> \e
\-\-description "This is a sample backup plan"
.RE
To add backup rules to an existing backup plan \f5\fIsample\-backup\-plan\fR\fR
in project \f5\fIsample\-project\fR\fR, at location \f5\fIus\-central1\fR\fR:
run:
.RS 2m
$ gcloud backup\-dr backup\-plans update sample\-backup\-plan \e
\-\-project=sample\-project \-\-location=us\-central1 \e
\-\-add\-backup\-rule <BACKUP\-RULE> \-\-add\-backup\-rule <BACKUP\-RULE>
.RE
To remove a backup rule with id \f5\fIsample\-daily\-rule\fR\fR from an existing
backup plan \f5\fIsample\-backup\-plan\fR\fR in project
\f5\fIsample\-project\fR\fR, at location \f5\fIus\-central1\fR\fR:
run:
.RS 2m
$ gcloud backup\-dr backup\-plans update sample\-backup\-plan \e
\-\-project=sample\-project \-\-location=us\-central1 \e
\-\-remove\-backup\-rule sample\-daily\-rule
.RE
To override backup rules in an existing backup plan
\f5\fIsample\-backup\-plan\fR\fR in project \f5\fIsample\-project\fR\fR, at
location \f5\fIus\-central1\fR\fR, pass a file path containing backup rules in
YAML or JSON format: This flag is mutually exclusive with \-\-add\-backup\-rule,
\-\-remove\-backup\-rule and \-\-backup\-rule flags.
run:.RS 2m
$ gcloud backup\-dr backup\-plans update sample\-backup\-plan \e
\-\-project=sample\-project \-\-location=us\-central1 \e
\-\-backup\-rules\-fom\-file <FILE_PATH>
.RE
Backup Rule Examples:
1. Hourly backup rule with hourly backup frequency of 6 hours and store it for
30 days, and expect the backups to run only between 10:00 to 20:00 UTC
<BACKUP\-RULE>:
rule\-id=sample\-hourly\-rule,retention\-days=30,recurrence=HOURLY,hourly\-frequency=6,time\-zone=UTC,backup\-window\-start=10,backup\-window\-end=20
Properties:
.RS 2m
.IP "\(bu" 2m
rule\-id = "sample\-hourly\-rule"
.IP "\(bu" 2m
retention\-days = 30
.IP "\(bu" 2m
recurrence = HOURLY
.IP "\(bu" 2m
hourly\-frequency = 6
.IP "\(bu" 2m
time\-zone = UTC
.IP "\(bu" 2m
backup\-window\-start = 10
.IP "\(bu" 2m
backup\-window\-end = 20
.RE
.sp
2. Daily backup rule with daily backup frequency of 6 hours and store it for 7
days
<BACKUP\-RULE>:
rule\-id=sample\-daily\-rule,retention\-days=7,recurrence=DAILY,backup\-window\-start=1,backup\-window\-end=14
Properties:
.RS 2m
.IP "\(bu" 2m
rule\-id = "sample\-daily\-rule"
.IP "\(bu" 2m
retention\-days = 7
.IP "\(bu" 2m
recurrence = DAILY
.IP "\(bu" 2m
backup\-window\-start = 1
.IP "\(bu" 2m
backup\-window\-end = 14
.RE
.sp
3. Weekly backup rule with weekly backup frequency on every MONDAY & FRIDAY and
store it for 21 days
<BACKUP\-RULE>:
rule\-id=sample\-weekly\-rule,retention\-days=21,recurrence=WEEKLY,days\-of\-week="MONDAY
FRIDAY",backup\-window\-start=10,backup\-window\-end=20
Properties:
.RS 2m
.IP "\(bu" 2m
rule\-id = "sample\-weekly\-rule"
.IP "\(bu" 2m
retention\-days: 21
.IP "\(bu" 2m
recurrence = WEEKLY
.IP "\(bu" 2m
days\-of\-week = "MONDAY FRIDAY"
.IP "\(bu" 2m
backup\-window\-start = 10
.IP "\(bu" 2m
backup\-window\-end = 20
.RE
.sp
YAML and JSON file examples:
YAML file example:
.RS 2m
backup\-rules:
\- rule\-id: weekly\-rule
retention\-days: 7
recurrence: WEEKLY
backup\-window\-start: 0
backup\-window\-end: 23
days\-of\-week: [MONDAY, TUESDAY]
time\-zone: UTC
\- rule\-id: daily\-rule
retention\-days: 1
recurrence: DAILY
backup\-window\-start: 1
backup\-window\-end: 24
time\-zone: UTC
.RE
JSON file example:.RS 2m
{
"backup\-rules": [
{
"rule\-id": "weekly\-rule",
"retention\-days": 7,
"recurrence": "WEEKLY",
"backup\-window\-start": 0,
"backup\-window\-end": 23,
"days\-of\-week": ["MONDAY", "TUESDAY"],
"time\-zone": "UTC"
},
{
"rule\-id": "daily\-rule",
"retention\-days": 1,
"recurrence": "DAILY",
"backup\-window\-start": 1,
"backup\-window\-end": 24,
"time\-zone": "UTC"
}
]
}
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Backup Plan resource \- Name of the backup plan to be updated. The name must be
unique for a project and location. The arguments in this group can be used to
specify the attributes of this resource. (NOTE) Some attributes are not given
arguments in this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5backup_plan\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fIBACKUP_PLAN\fR
ID of the Backup Plan or fully qualified identifier for the Backup Plan.
To set the \f5name\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5backup_plan\fR on the command line.
.RE
.sp
This positional argument must be specified if any of the other arguments in this
group are specified.
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
The location of the Backup Plan.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5backup_plan\fR on the command line with a fully
specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-add\-backup\-rule\fR=[\fIPROPERTY\fR=\fIVALUE\fR,...]
Parameters of backup rule to be added to the Backup Plan. This flag can be
repeated to add more backup rules.
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
The default is \fBTrue\fR. Enabled by default, use \fB\-\-no\-async\fR to
disable.
.TP 2m
\fB\-\-backup\-rule\fR=[\fIPROPERTY\fR=\fIVALUE\fR,...]
Full definition of an existing backup rule with updated values. The existing
backup rule is replaced by this new set of values. This flag can be repeated to
update multiple backup rules. It is not allowed to pass the same rule\-id in
this flag more than once in the same command.
Parameters for the backup rule include:
.RS 2m
.TP 2m
\fBrule\-id\fR
Name of the backup rule. The name must be unique and start with a lowercase
letter followed by up to 62 lowercase letters, numbers, or hyphens.
.TP 2m
\fBretention\-days\fR
Duration for which backup data should be retained. It must be defined in "days".
The value should be greater than or equal to the enforced retention period set
for the backup vault.
.TP 2m
\fBrecurrence\fR
Frequency for the backup schedule. It must be either: HOURLY, DAILY, WEEKLY,
MONTHLY or YEARLY.
.TP 2m
\fBbackup\-window\-start\fR
Start time of the interval during which backup jobs should be executed. It can
be defined as backup\-window\-start=2, that means backup window starts at 2 a.m.
The start time and end time must have an interval of 6 hours.
.TP 2m
\fBbackup\-window\-end\fR
End time of the interval during which backup jobs should be executed. It can be
defined as backup\-window\-end=14, that means backup window ends at 2 p.m. The
start time and end time must have an interval of 6 hours.
Jobs are queued at the beginning of the window and will be marked as
\f5SKIPPED\fR if they do not start by the end time. Jobs that are in progress
will not be canceled at the end time.
.TP 2m
\fBtime\-zone\fR
The time zone to be used for the backup schedule. The value must exist in the
IANA tz database (https://www.iana.org/time\-zones). The default value is UTC.
E.g., Europe/Paris
.TP 2m
Following flags are mutually exclusive:
.TP 2m
\fBhourly\-frequency\fR
Frequency for hourly backups. An hourly frequency of 2 means backup jobs will
run every 2 hours from start time till the end time defined. The hourly
frequency must be between 4 and 23. The value is needed only if recurrence type
is HOURLY.
.TP 2m
\fBdays\-of\-week\fR
Days of the week when the backup job should be executed. The value is needed if
recurrence type is WEEKLY. E.g., MONDAY,TUESDAY
.TP 2m
\fBdays\-of\-month\fR
Days of the month when the backup job should be executed. The value is needed
only if recurrence type is YEARLY. E.g.,"1,5,14"
.TP 2m
\fBmonths\fR
Month for the backup schedule. The value is needed only if recurrence type is
YEARLY. E.g., JANUARY, MARCH
.TP 2m
\fBweek\-day\-of\-month\fR
Recurring day of the week in the month or year when the backup job should be
executed. E.g. FIRST\-SUNDAY, THIRD\-MONDAY. The value can only be provided if
the recurrence type is MONTHLY or YEARLY. Allowed values for the number of week
\- FIRST, SECOND, THIRD, FOURTH, LAST. Allowed values for days of the week \-
MONDAY to SUNDAY.
.TP 2m
E.g.,
"rule\-id=sample\-daily\-rule,recurrence=WEEKLY,backup\-window\-start=2,backup\-window\-end=14,retention\-days=20,days\-of\-week='SUNDAY
MONDAY'"
.RE
.sp
.TP 2m
\fB\-\-backup\-rules\-from\-file\fR=\fIPATH_TO_FILE\fR
Path to a YAML or JSON file containing backup rules. Use a full or relative path
to a local file containing the value of backup_rules.
.TP 2m
\fB\-\-description\fR=\fIDESCRIPTION\fR
Provide a description of the backup plan, such as specific use cases and
relevant details, in 2048 characters or less.
E.g., This is a backup plan that performs a daily backup at 6 p.m. and retains
data for 3 months.
.TP 2m
\fB\-\-remove\-backup\-rule\fR=\fIRULE\-ID\fR
Name of an existing backup rule to be removed from the Backup Plan. This flag
can be repeated to remove more backup rules.
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "BRIEF"
Update a specific backup plan
.SH "NOTES"
This variant is also available:
.RS 2m
$ gcloud alpha backup\-dr backup\-plans update
.RE