Skip to main content

Schedule Policy

Description

The px pxb schedulepolicy commands manage reusable backup schedule policies that define when and how often backups run. Policies can include any combination of interval, daily, weekly, and monthly schedules; each with retention and optional incremental-count settings. Policies also support object-lock and auto-delete options and can be labeled for organization and filtering.

Usage

Create Schedule Policy

px pxb create schedulepolicy --name <policy-name> [flags]

Get Schedule Policy (Inspect)

px pxb get schedulepolicy --name <policy-name> [--uid <uid>] [flags]

Get Schedule Policy (List All)

px pxb get schedulepolicy [flags]

Update Schedule Policy

px pxb update schedulepolicy --name <policy-name> [--uid <uid>] [flags]

Delete Schedule Policy

px pxb delete schedulepolicy --name <policy-name> [--uid <uid>] [flags]

Update Ownership (Schedule Policy)

px pxb update ownership schedulepolicy --name <policy-name> [--uid <uid>] [flags]

Examples

Create simple daily policy

px pxb create schedulepolicy \
--name daily-2am \
--daily-time "2:00AM" \
--daily-retain 7

Create comprehensive policy (interval + daily + weekly + monthly)

px pxb create schedulepolicy \
--name comprehensive \
--interval-minutes 60 --interval-retain 5 --interval-incremental-count 3 \
--daily-time "1:00AM" --daily-retain 7 --daily-incremental-count 6 \
--weekly-day Monday --weekly-time "3:00AM" --weekly-retain 4 --weekly-incremental-count 2 \
--monthly-date 1 --monthly-time "4:00AM" --monthly-retain 12 --monthly-incremental-count 1

Create object-lock policy

px pxb create schedulepolicy \
--name object-lock \
--for-object-lock \
--auto-delete \
--daily-time "2:00AM"

Create from file

px pxb create schedulepolicy --file /path/to/schedulepolicy-create.json

Get policies (inspect and list)

# Inspect one
px pxb get schedulepolicy --name daily-2am

# List all
px pxb get schedulepolicy

# List filtered by labels
px pxb get schedulepolicy --labels env=prod,team=platform

Update policy

# Update daily time and retention
px pxb update schedulepolicy --name daily-2am --daily-time "3:00AM" --daily-retain 10

# Update from file
px pxb update schedulepolicy --file /path/to/schedulepolicy-update.json

Delete policy

px pxb delete schedulepolicy --name daily-2am

Update ownership

# Add groups and collaborators
px pxb update ownership schedulepolicy \
--name daily-2am \
--add-groups "dev=Read,ops=Write,admins=Admin" \
--add-collaborators "alice@corp.com=Write,bob@corp.com=Admin" \
--public-access-control Read

# From file (name can be in file)
px pxb update ownership schedulepolicy --file /path/to/schedulepolicy-ownership.json

Flags for commands and sub-commands

Create Schedule Policy Flags

Required Flags (optional with --file)

FlagShortTypeDescription
--name-nstringName of the schedule policy (required, optional with --file)

Optional Identification

FlagShortTypeDescription
--uidstringUID of the schedule policy (optional)

Schedule Configuration

FlagShortTypeDescription
--interval-minutesint64Interval minutes (minimum 15)
--interval-retainint64Retention for interval backups (default: 5)
--interval-incremental-countint64Incremental count for interval backups (minimum: 0, default: 6)
--daily-timestringDaily backup time (e.g., 11:20AM)
--daily-retainint64Retention for daily backups (default: 7)
--daily-incremental-countint64Incremental count for daily backups (minimum: 0, default: 6)
--weekly-daystringWeekly backup day (e.g., Mon, Monday, Sunday)
--weekly-timestringWeekly backup time (e.g., 11:20PM)
--weekly-retainint64Retention for weekly backups (default: 5)
--weekly-incremental-countint64Incremental count for weekly backups (minimum: 0, default: 6)
--monthly-dateint64Monthly backup date (1-31)
--monthly-timestringMonthly backup time (e.g., 11:20PM)
--monthly-retainint64Retention for monthly backups (default: 12)
--monthly-incremental-countint64Incremental count for monthly backups (minimum: 0, default: 6)
--for-object-lockboolEnable object-lock for this policy
--auto-deleteboolEnable auto-delete for object-locked bucket schedules

Metadata

FlagShortTypeDescription
--labelsmapLabels to set (key=value,key2=value2)

File Input

FlagShortTypeDescription
--file-fstringJSON/YAML file with full policy configuration
--labels-filestringJSON file with labels map

Get Schedule Policy Flags

Resource Identification

FlagShortTypeDescription
--name-nstringName of policy to inspect (required for inspect; omit to list all)
--uid-ustringUID of policy (optional; used with --name)

Filtering

FlagShortTypeDescription
--labelsmapFilter by labels (key=value,key2=value2)

File Input

FlagShortTypeDescription
--file-fstringJSON/YAML file with inspect or enumerate request
--labels-filestringJSON file with labels map for filtering

Update Schedule Policy Flags

Required Identification (optional with --file)

FlagShortTypeDescription
--name-nstringName of the schedule policy to update (optional with --file, required otherwise)
--uid-ustringUID of the schedule policy to update (optional)

Update Fields

FlagShortTypeDescription
--interval-minutesint64Update interval minutes
--interval-retainint64Update interval retention
--interval-incremental-countint64Update interval incremental count
--daily-timestringUpdate daily time
--daily-retainint64Update daily retention
--daily-incremental-countint64Update daily incremental count
--weekly-daystringUpdate weekly day
--weekly-timestringUpdate weekly time
--weekly-retainint64Update weekly retention
--weekly-incremental-countint64Update weekly incremental count
--monthly-dateint64Update monthly date
--monthly-timestringUpdate monthly time
--monthly-retainint64Update monthly retention
--monthly-incremental-countint64Update monthly incremental count
--for-object-lockboolEnable/disable object-lock
--auto-deleteboolEnable/disable auto-delete for object-locked bucket schedules
--labelsmapUpdate labels (key=value,key2=value2)

File Input

FlagShortTypeDescription
--file-fstringJSON/YAML file with full update configuration
--labels-filestringJSON file with labels map

Delete Schedule Policy Flags

Required Identification

FlagShortTypeDescription
--name-nstringName of the schedule policy to delete (optional with --file, required otherwise)

Optional Identification

FlagShortTypeDescription
--uid-ustringUID of the schedule policy to delete (optional)

File Input

FlagShortTypeDescription
--file-fstringJSON/YAML file with delete configuration

Update Ownership (Schedule Policy) Flags

Required Identification

FlagShortTypeDescription
--name-nstringName of the schedule policy to modify ownership for (optional with --file, required otherwise)

Optional Identification

FlagShortTypeDescription
--uid-ustringUID of the schedule policy (optional)

Access Management

FlagShortTypeDescription
--add-groupsmapAdd groups with access levels (e.g., dev=Read,ops=Write,admins=Admin)
--add-collaboratorsmapAdd collaborators with access levels (e.g., alice@corp.com=Write,bob@corp.com=Admin)
--public-access-controlstringPublic access level: Read, Write, or Admin

File Input

FlagShortTypeDescription
--file-fstringJSON file containing complete ownership configuration
--add-groups-filestringJSON file with groups and access levels
--add-collaborators-filestringJSON file with collaborators and access levels

Notes

  • Get dual mode: without --name enumerates; with --name inspects one (optionally add --uid).
  • Create/Update: when using --file, identifiers may come from the file; CLI flags override file values. Labels may be supplied via --labels or --labels-file.
  • Delete: requires --name; --uid is optional.
  • Ownership update: requires --name; --uid optional. When using --file, it is mutually exclusive with granular ownership flags.
  • Precedence: CLI flags override granular *-file inputs, which override --file.

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 from context (used for get filtering when not provided explicitly)