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)
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule policy (required, optional with --file) |
Optional Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--uid | string | UID of the schedule policy (optional) |
Schedule Configuration
| Flag | Short | Type | Description |
|---|---|---|---|
--interval-minutes | int64 | Interval minutes (minimum 15) | |
--interval-retain | int64 | Retention for interval backups (default: 5) | |
--interval-incremental-count | int64 | Incremental count for interval backups (minimum: 0, default: 6) | |
--daily-time | string | Daily backup time (e.g., 11:20AM) | |
--daily-retain | int64 | Retention for daily backups (default: 7) | |
--daily-incremental-count | int64 | Incremental count for daily backups (minimum: 0, default: 6) | |
--weekly-day | string | Weekly backup day (e.g., Mon, Monday, Sunday) | |
--weekly-time | string | Weekly backup time (e.g., 11:20PM) | |
--weekly-retain | int64 | Retention for weekly backups (default: 5) | |
--weekly-incremental-count | int64 | Incremental count for weekly backups (minimum: 0, default: 6) | |
--monthly-date | int64 | Monthly backup date (1-31) | |
--monthly-time | string | Monthly backup time (e.g., 11:20PM) | |
--monthly-retain | int64 | Retention for monthly backups (default: 12) | |
--monthly-incremental-count | int64 | Incremental count for monthly backups (minimum: 0, default: 6) | |
--for-object-lock | bool | Enable object-lock for this policy | |
--auto-delete | bool | Enable auto-delete for object-locked bucket schedules |
Metadata
| Flag | Short | Type | Description |
|---|---|---|---|
--labels | map | Labels to set (key=value,key2=value2) |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON/YAML file with full policy configuration |
--labels-file | string | JSON file with labels map |
Get Schedule Policy Flags
Resource Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of policy to inspect (required for inspect; omit to list all) |
--uid | -u | string | UID of policy (optional; used with --name) |
Filtering
| Flag | Short | Type | Description |
|---|---|---|---|
--labels | map | Filter by labels (key=value,key2=value2) |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON/YAML file with inspect or enumerate request |
--labels-file | string | JSON file with labels map for filtering |
Update Schedule Policy Flags
Required Identification (optional with --file)
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule policy to update (optional with --file, required otherwise) |
--uid | -u | string | UID of the schedule policy to update (optional) |
Update Fields
| Flag | Short | Type | Description |
|---|---|---|---|
--interval-minutes | int64 | Update interval minutes | |
--interval-retain | int64 | Update interval retention | |
--interval-incremental-count | int64 | Update interval incremental count | |
--daily-time | string | Update daily time | |
--daily-retain | int64 | Update daily retention | |
--daily-incremental-count | int64 | Update daily incremental count | |
--weekly-day | string | Update weekly day | |
--weekly-time | string | Update weekly time | |
--weekly-retain | int64 | Update weekly retention | |
--weekly-incremental-count | int64 | Update weekly incremental count | |
--monthly-date | int64 | Update monthly date | |
--monthly-time | string | Update monthly time | |
--monthly-retain | int64 | Update monthly retention | |
--monthly-incremental-count | int64 | Update monthly incremental count | |
--for-object-lock | bool | Enable/disable object-lock | |
--auto-delete | bool | Enable/disable auto-delete for object-locked bucket schedules | |
--labels | map | Update labels (key=value,key2=value2) |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON/YAML file with full update configuration |
--labels-file | string | JSON file with labels map |
Delete Schedule Policy Flags
Required Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule policy to delete (optional with --file, required otherwise) |
Optional Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--uid | -u | string | UID of the schedule policy to delete (optional) |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON/YAML file with delete configuration |
Update Ownership (Schedule Policy) Flags
Required Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule policy to modify ownership for (optional with --file, required otherwise) |
Optional Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--uid | -u | string | UID of the schedule policy (optional) |
Access Management
| Flag | Short | Type | Description |
|---|---|---|---|
--add-groups | map | Add groups with access levels (e.g., dev=Read,ops=Write,admins=Admin) | |
--add-collaborators | map | Add collaborators with access levels (e.g., alice@corp.com=Write,bob@corp.com=Admin) | |
--public-access-control | string | Public access level: Read, Write, or Admin |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | -f | string | JSON file containing complete ownership configuration |
--add-groups-file | string | JSON file with groups and access levels | |
--add-collaborators-file | string | JSON file with collaborators and access levels |
Notes
- Get dual mode: without
--nameenumerates; with--nameinspects 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--labelsor--labels-file. - Delete: requires
--name;--uidis optional. - Ownership update: requires
--name;--uidoptional. When using--file, it is mutually exclusive with granular ownership flags. - Precedence: CLI flags override granular
*-fileinputs, 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)