Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager backup snapshots schedule update

On this page

  • Syntax
  • Options
  • Output
  • Examples

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.

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.

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: 15, 30, and 60.

Important

--clusterCheckpointIntervalMin only applies to sharded clusters.

You may use checkpoints for clusters that run MongoDB with Feature Compatibility Version of 4.0 or earlier. Checkpoints were removed from MongoDB instances with FCV of 4.2 or later.

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 0 and 365, inclusive.

Note

To disable daily snapshot retention, set --dailySnapshotRetentionDays to 0.

no
--monthlySnapshotRetentionMonths
integer

Months to retain monthly snapshots. Ops Manager accepts values between 0 and 36, inclusive.

Note

To disable monthly snapshot retention, set --monthlySnapshotRetentionMonths to 0.

no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

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 0 and 52, inclusive.

Note

To disable weekly snapshot retention, set --weeklySnapshotRetentionWeeks to 0.

no

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:

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}

Back

Describe One Backup Snapshot Schedule