mongocli atlas backup snapshots create
The backup snapshots create
command creates a backup snapshot on the
specified cluster. You can also create a backup snapshot through the
Atlas UI
or API.
Important
On-demand backup snapshots are available to Atlas cluster tiers
M10
and higher. Learn more about upgrading
a cluster to a higher tier.
Syntax
mongocli atlas backup snapshots create <cluster-name> --desc "<description-of-snapshot>" --retention <number-of-days> [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
<cluster-name> | string | Name of the cluster. | yes |
--desc | string | Description of the snapshot. | yes |
--retention | integer | Number of days to retain the snapshot. | yes |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | 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 |
Output
If the command is successful, it returns the following response:
Snapshot '<snapshot-id>' created.
Example
The following example uses the mongocli atlas backup snapshots create
command to create a backup snapshot for the cluster named myDemo
. The
command uses the default profile, where the project ID and the
Programmatic API Keys are stored.
mongocli atlas backups snapshots create myDemo --desc "Daily snapshot" --retention 30
The command prints the following output to the terminal.
Snapshot '5f4006d29d52d968122ee664' created.