Skip to main content

Backup Location

Description

The px pxb backuplocation commands manage backup locations used to store backups. A backup location can be an S3-compatible object store, Azure Blob Storage, Google Cloud Storage, or an on-premises NFS path. You can create, validate, update, list, delete, and manage ownership of backup locations.

Usage

Create Backup Location

px pxb create backuplocation --name <location-name> \
--provider <s3|azure|google|nfs> --path <bucket-or-path> [flags]

Get Backup Location (Inspect)

px pxb get backuplocation --name <location-name> [--uid <uid>] [flags]

Get Backup Location (List All)

px pxb get backuplocation [flags]

Update Backup Location

px pxb update backuplocation --name <location-name> [--uid <uid>] [flags]

Delete Backup Location

px pxb delete backuplocation --name <location-name> [--uid <uid>] [flags]

Validate Backup Location

px pxb validate backuplocation --name <location-name> [--uid <uid>] [flags]

Update Ownership (Access Control)

px pxb update ownership backuplocation --name <location-name> [--uid <uid>] [flags]

Examples

Create S3 Backup Location

px pxb create backuplocation \
--name s3-primary \
--provider s3 \
--path px-backups/app \
--cloud-credential-name aws-cred \
--s3-endpoint s3.amazonaws.com \
--s3-region us-east-1

Create S3 with encryption and object lock

px pxb create backuplocation \
--name encrypted-s3 \
--provider s3 \
--path secure-bucket/px \
--cloud-credential-name aws-cred \
--s3-endpoint s3.amazonaws.com \
--s3-region us-west-2 \
--s3-sse SSE-KMS \
--encryption-key myKmsKeyAlias \
--object-lock-enabled

Create GCS Backup Location

px pxb create backuplocation \
--name gcs-backups \
--provider google \
--path gcs-bucket/backups \
--cloud-credential-name gcp-cred

Create Azure Blob Backup Location

# Basic Azure backup location (defaults to AZURE_GLOBAL environment)
px pxb create backuplocation \
--name azure-backups \
--provider azure \
--path container-name-prefix \
--cloud-credential-name azure-cred

# Azure backup location with explicit global environment
px pxb create backuplocation \
--name azure-global \
--provider azure \
--path container-name-global-backups \
--cloud-credential-name azure-cred \
--azure-environment AZURE_GLOBAL

# Azure backup location for China environment
px pxb create backuplocation \
--name azure-china \
--provider azure \
--path container-name-china-backups \
--cloud-credential-name azure-china-cred \
--azure-environment AZURE_CHINA

# Azure backup location with resource group (for immutable buckets)
px pxb create backuplocation \
--name azure-immutable \
--provider azure \
--path container-name-immutable-backups \
--cloud-credential-name azure-cred \
--azure-environment AZURE_GLOBAL \
--azure-resource-group my-backup-resource-group

Create NFS Backup Location

px pxb create backuplocation \
--name nfs-archive \
--provider nfs \
--path /exports/backups \
--nfs-server-addr 10.0.0.10 \
--nfs-mount-options "vers=4,rsize=1048576"

Validate and List

px pxb validate backuplocation --name s3-primary
px pxb get backuplocation --output json

# List all backup locations
px pxb get backuplocation

# Filter by cloud credential
px pxb get backuplocation --cloud-credential-name aws-cred --include-secrets

# Exclude validation state and filter by labels
px pxb get backuplocation --include-validation-state=false --labels-file /path/to/labels.json

Note: By default, px pxb get backuplocation shows ALL backup locations including those in ValidationInProgress and ValidationFailed states. Use --include-validation-state=false to hide NFS backup locations that are currently being validated or have failed validation.

Update Cloud Credential or Settings

px pxb update backuplocation --name s3-primary --cloud-credential-name aws-cred-rotated
px pxb update backuplocation --name s3-primary --validate-cloud-credential=false
px pxb update backuplocation --name s3-primary --provider s3 --s3-endpoint new-endpoint --s3-region eu-west-1

# Update Azure configuration
px pxb update backuplocation --name azure-backups --provider azure --azure-environment AZURE_CHINA --cloud-credential-name azure-cred
px pxb update backuplocation --name azure-backups --provider azure --azure-resource-group new-resource-group --cloud-credential-name azure-cred
px pxb update backuplocation --name azure-backups --provider azure --azure-environment AZURE_GLOBAL --azure-resource-group prod-rg --cloud-credential-name azure-cred

# Update NFS configuration
px pxb update backuplocation --name nfs-archive --provider nfs --nfs-server-addr 10.0.0.20 --nfs-sub-path production/backups --nfs-mount-options "vers=4,rsize=2097152"

Delete

px pxb delete backuplocation --name s3-primary

Update Ownership

# Add groups with access levels
px pxb update ownership backuplocation --name s3-primary \
--add-groups "devops=Admin,ops=Write"

# Add collaborators
px pxb update ownership backuplocation --name s3-primary \
--add-collaborators "alice-user-123=Read"

# From file (CLI flags override file)
px pxb update ownership backuplocation --name s3-primary \
--file /path/to/backuplocation-ownership.json

Ownership file examples

Complete ownership request (backuplocation-ownership.json):

{
"name": "s3-primary",
"ownership": {
"groups": [
{ "id": "devops", "access": "Admin" },
{ "id": "ops", "access": "Write" }
],
"collaborators": [
{ "id": "alice-user-123", "access": "Read" }
],
"public": { "type": "Read" }
}
}

Granular files:

// groups.json
{
"devops": "Admin",
"ops": "Write"
}
// collaborators.json
{
"alice-user-123": "Read"
}

Flags for commands and sub-commands

Create Backup Location Flags

Required Flags (optional with --file)

FlagShortTypeDescription
--name-nstringName of the backup location (required, optional with --file)
--provider-pstringStorage provider: s3, azure, google, nfs (required, optional with --file)
--pathstringStorage path (bucket/prefix for cloud; directory for NFS) (required, optional with --file)

Common Options

FlagShortTypeDescription
--cloud-credential-namestringName of cloud credential to use
--cloud-credential-uidstringUID of cloud credential to use
--validate-cloud-credentialboolValidate cloud credential before creating (default: true)
--encryption-keystringEncryption key for backup data
--object-lock-enabledboolEnable object lock for immutable backups (S3 only)
--file-fstringYAML/JSON file containing complete backup location configuration
--s3-config-filestringYAML/JSON file containing S3-specific configuration
--nfs-config-filestringYAML/JSON file containing NFS-specific configuration

S3 Options

FlagShortTypeDescription
--s3-endpointstringS3 endpoint URL (e.g., s3.amazonaws.com)
--s3-regionstringS3 region (e.g., us-west-2)
--s3-ssestringS3 server-side encryption: SSE-S3 or SSE-KMS
--s3-disable-sslboolDisable SSL for S3 connections
--s3-disable-path-styleboolDisable path-style addressing for S3

Azure Options

FlagShortTypeDescription
--azure-environmentstringAzure environment: AZURE_GLOBAL, AZURE_CHINA (default: AZURE_GLOBAL)
--azure-resource-groupstringAzure resource group name (optional, for immutable buckets)

NFS Options

FlagShortTypeDescription
--nfs-server-addrstringNFS server address (IP or hostname)
--nfs-sub-pathstringSubdirectory under NFS export path
--nfs-mount-optionsstringNFS mount options (e.g., "vers=4,rsize=1048576")

Get Backup Location Flags

Inspect (optional with --file)

FlagShortTypeDescription
--namestringName to inspect (optional with --file, required for inspect mode otherwise)
--uidstringUID of the location (optional; use with --name to disambiguate)

Enumerate Filters

FlagShortTypeDescription
--cloud-credential-namestringFilter by cloud credential name
--cloud-credential-uidstringFilter by cloud credential UID
--include-secretsboolInclude secrets in the output
--include-validation-statetrueboolInclude backup locations in ValidationInProgress and ValidationFailed states (default: true)
--labels-filestringPath to YAML/JSON file containing labels for filtering

File Input

FlagShortTypeDescription
--file-fstringYAML/JSON file containing complete get configuration

Update Backup Location Flags

Identification

FlagShortTypeDescription
--name-nstringName of the location to update (required, optional with --file)
--uidstringUID of the location to update (optional)

Cloud Credentials

FlagShortTypeDescription
--cloud-credential-namestringNew cloud credential name
--cloud-credential-uidstringNew cloud credential UID
--validate-cloud-credentialboolValidate cloud credential (default: true)

Provider Configuration

FlagShortTypeDescription
--provider-pstringUpdate storage provider configuration: s3, azure, google, nfs

S3 Options

FlagShortTypeDescription
--s3-endpointstringS3 endpoint URL
--s3-regionstringS3 region
--s3-disable-sslboolDisable SSL for S3 connections
--s3-disable-path-styleboolDisable path-style addressing for S3

NFS Options

FlagShortTypeDescription
--nfs-server-addrstringNFS server address
--nfs-sub-pathstringNFS subdirectory path
--nfs-mount-optionsstringNFS mount options

File Input (granular)

FlagShortTypeDescription
--s3-config-filestringYAML/JSON file containing S3-specific configuration
--nfs-config-filestringYAML/JSON file containing NFS-specific configuration

Delete Backup Location Flags

FlagShortTypeDescription
--namestringName of the backup location to delete (required, optional with --file)
--uidstringUID of the backup location (optional)

Validate Backup Location Flags

FlagShortTypeDescription
--namestringName of the backup location (required, optional with --file)
--uidstringUID of the backup location (optional)

Ownership Update Flags

Required Identification (optional with --file)

FlagShortTypeDescription
--name-nstringName of the backup location (optional with --file, required otherwise)
--uidstringUID of the backup location (optional)

Ownership Management

FlagShortTypeDescription
--add-groupsmapAdd groups with access levels (group=Read|Write|Admin)
--add-collaboratorsmapAdd collaborators with access levels (user=Read|Write|Admin)
--public-access-controlstringSet public access control: Read, Write, or Admin

File Input

FlagShortTypeDescription
--file-fstringYAML/JSON file containing complete ownership configuration
--add-groups-filestringYAML/JSON file containing groups configuration
--add-collaborators-filestringYAML/JSON file containing collaborators configuration

Azure Environment and Resource Group Details

Azure Environments

The --azure-environment flag specifies which Azure cloud environment to use:

  • AZURE_GLOBAL (default): Azure public cloud environment used worldwide
  • AZURE_CHINA: Azure China cloud environment operated by 21Vianet

If no environment is specified, AZURE_GLOBAL is used by default.

Azure Resource Groups

The --azure-resource-group flag is optional and serves several purposes:

  • Immutable Storage: Required for Azure immutable storage containers to retrieve retention period information
  • Resource Organization: Helps organize backup storage resources within Azure resource groups
  • Compliance: May be required for certain compliance or governance requirements

Azure Configuration Examples

# Default global environment (no environment flag needed)
px pxb create backuplocation --name azure-default --provider azure --path container-backups --cloud-credential-name azure-creds

# Explicit global environment
px pxb create backuplocation --name azure-global --provider azure --path container-backups --cloud-credential-name azure-creds --azure-environment AZURE_GLOBAL

# China environment
px pxb create backuplocation --name azure-china --provider azure --path container-backups --cloud-credential-name azure-china-creds --azure-environment AZURE_CHINA

# With resource group for immutable storage
px pxb create backuplocation --name azure-immutable --provider azure --path container-backups --cloud-credential-name azure-creds --azure-environment AZURE_GLOBAL --azure-resource-group backup-rg

Notes

  • Get semantics: Use --name to inspect a single backup location (UID optional); omit --name to enumerate all. Cloud credential filters apply only to enumeration.
  • Required identification: For update, delete, validate, and ownership, --name is required; --uid is optional and used to disambiguate.
  • File vs CLI precedence:
    • Create supports --file, --s3-config-file, and --nfs-config-file. CLI flags override values from files.
    • Note: When using --file on create, the required name may come from the file payload. If neither file nor CLI provides a name, the command fails validation.
    • Update supports granular provider files (--s3-config-file, --nfs-config-file); there is no top-level --file for update.
  • Provider validation: Provider-specific flags are validated only when the selected provider is specified.
  • Azure environment validation: Only AZURE_GLOBAL and AZURE_CHINA are accepted values for --azure-environment.

Output Format Support

  • --output table (default)
  • --output json
  • --output yaml
  • --output name (for get)

Authentication and Context

  • Organization ID from context
  • Authentication token from context
  • Labels for list filtering from context