Docs Menu
Docs Home
/ /
Atlas CLI
/ / / / /

atlas backups compliancePolicy policies ondemand create

Create the on-demand policy item of the backup compliance policy for your project.

Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link.

Command Syntax
atlas backups compliancePolicy policies ondemand create [options]
Name
Type
Required
Description

-h, --help

false

help for create

-o, --output

string

false

Output format. Valid values are json, json-path, go-template, or go-template-file. To see the full output, use the -o json option.

--projectId

string

false

Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable.

--retentionUnit

string

true

Unit of time in which Atlas measures snapshot retention: 'days' 'weeks' 'months'.

--retentionValue

int

true

Duration in days, weeks, or months that Atlas retains the snapshot. For less frequent policy items, Atlas requires that you specify a value greater than or equal to the value specified for more frequent policy items.

-w, --watch

false

Flag that indicates whether to watch the command until it completes its execution or the watch times out.

Name
Type
Required
Description

-P, --profile

string

false

# Create a backup compliance on-demand policy with a retention of two weeks:
atlas backups compliancepolicy policies ondemand create --retentionUnit weeks --retentionValue 2

Back

ondemand

On this page