mongocli ops-manager backup snapshots schedule update
The backup snapshots schedule update
command updates the backup
snapshot schedule for the specified cluster. You can also update the
backup snapshot schedule through the Ops Manager UI
or API.
Syntax
mongocli ops-manager|om backup(s) snapshot(s) schedule update [ --clusterCheckpointIntervalMin <checkpoint-interval-minutes> ] --clusterId <cluster-id> [ --dailySnapshotRetentionDays <retention-days> ] [ --monthlySnapshotRetentionMonths <retention-months> ] [ --output|-o <output-format> ] [ --pointInTimeWindowHours <pit-window-hours> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ] [ --referenceHourOfDay <reference-hour-of-day> ] [ --referenceMinuteOfHour <reference-minute-of-hour> ] [ --referenceTimeZoneOffset <reference-timezone-offset> ] [ --snapshotIntervalHours <snapshot-interval-hours> ] [ --snapshotRetentionDays <snapshot-retention-days> ] [ --weeklySnapshotRetentionWeeks <weekly-snapshot-retention-weeks> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
--clusterCheckpointIntervalMin | integer | Minutes between successive cluster checkpoints. This number determines the granularity of point-in-time restores for sharded clusters. Ops Manager accepts the following values: Important
You may use checkpoints for clusters that run MongoDB with
| no |
--clusterId | string | Unique identifier of the cluster for which you want to retrieve
the backup snapshot schedule. | yes |
--dailySnapshotRetentionDays | integer | Days to retain daily snapshots. Ops Manager accepts values between
NoteTo disable daily snapshot retention, set | no |
--monthlySnapshotRetentionMonths | integer | Months to retain monthly snapshots. Ops Manager accepts values between
NoteTo disable monthly snapshot retention, set | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--pointInTimeWindowHours | integer | Number of hours in the past for which users can create a
point-in-time snapshot. | no |
--profile , -P | string | Name of the profile where the project ID and the Programmatic API Keys
for the project are saved. If omitted, uses the default profile.
To learn more about creating a profile, see Configure the MongoDB CLI. | no |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
--referenceHourOfDay | integer | Hour of the day to schedule snapshots using a 24 hour clock.
Ops Manager accepts values between 0 and 23 , inclusive. | no |
--referenceMinuteOfHour | integer | Minute of the hour to schedule snapshots. Ops Manager accepts values
between 0 and 59 , inclusive. | no |
--referenceTimeZoneOffset | string | The ISO-8601 timezone offset where the Ops Manager host resides. To
avoid problems with daylight saving time, use UTC. The
default is +0000 , which is equivalent to UTC. Z is
also a supported value and equivalent to UTC. | no |
--snapshotIntervalHours | integer | Hours between snapshots. Ops Manager accepts values of 6 , 8 ,
12 , and 24 . | no |
--snapshotRetentionDays | integer | Days to keep recent snapshots. Ops Manager accepts values between 2
and 30 , inclusive. | no |
--weeklySnapshotRetentionWeeks | integer | Weeks to retain weekly snapshots. Ops Manager accepts values between
NoteTo disable weekly snapshot retention, set | no |
Output
The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.
Snapshot schedule updated.
The default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the Public API reference for your MongoDB service:
Examples
The following command updates the backup snapshot schedule for the specified cluster. The command uses the default profile, which contains Ops Manager credentials. The MongoDB CLI returns the output in the default format.
mongocli om backup snapshot schedule update \ --clusterId 5f457bd5c90220199051210c \ --SnapshotRetentionDays 2
The previous command prints the following to the terminal.
Snapshot schedule updated.
The following command updates the backup snapshot schedule for the specified cluster. The command uses the default profile, which contains Ops Manager credentials. The MongoDB CLI returns the output in JSON format.
mongocli om backup snapshot schedule update \ --clusterId 5f457bd5c90220199051210c \ --SnapshotRetentionDays 2 \ -o json
The previous command prints the following to the terminal in JSON format.
1 { 2 "clusterId": "5f457bd5c90220199051210c", 3 "groupId": "5f1f39ffc902201990f53873", 4 "referenceTimeZoneOffset": "+0000", 5 "links": [ 6 { 7 "rel": "self", 8 "href": "http://example.com:8080/api/public/v1.0/groups/5f1f39ffc902201990f53873/backupConfigs/5f457bd5c90220199051210c/snapshotSchedule" 9 }, 10 { 11 "rel": "http://mms.mongodb.com/cluster", 12 "href": "http://example.com:8080/api/public/v1.0/groups/5f1f39ffc902201990f53873/clusters/5f457bd5c90220199051210c" 13 }, 14 { 15 "rel": "http://mms.mongodb.com/backupConfig", 16 "href": "http://example.com:8080/api/public/v1.0/groups/5f1f39ffc902201990f53873/backupConfigs/5f457bd5c90220199051210c" 17 }, 18 { 19 "rel": "http://mms.mongodb.com/group", 20 "href": "http://example.com:8080/api/public/v1.0/groups/5f1f39ffc902201990f53873" 21 } 22 ], 23 "monthlySnapshotRetentionMonths": 1, 24 "pointInTimeWindowHours": 0, 25 "referenceHourOfDay": 0, 26 "referenceMinuteOfHour": 0, 27 "snapshotIntervalHours": 24, 28 "snapshotRetentionDays": 2, 29 "weeklySnapshotRetentionWeeks": 2 30 }