Backup Schedule
Description
The px pxb backupschedule commands manage recurring backup schedules. A backup schedule ties a
schedule policy (when/how often to run) with backup parameters (what to back up, where to store it).
You can create, update, list, delete schedules, and suspend/resume them in bulk.
Usage
Create Backup Schedule
px pxb create backupschedule --name <schedule-name> --cluster <cluster-name> \
--schedule-policy-name <policy> --backup-location-name <location> [flags]
Get Backup Schedule (Inspect)
px pxb get backupschedule --name <schedule-name> [--uid <uid>] [flags]
Get Backup Schedule (List All)
px pxb get backupschedule [flags]
Update Backup Schedule (Single)
px pxb update backupschedule --name <schedule-name> --uid <uid> [flags]
Update Backup Schedule (Bulk)
px pxb update backupschedule --backup-object-type <type> --cluster-scope <scope> \
--include-filter <pattern> [filters] [flags]
Delete Backup Schedule(s)
px pxb delete backupschedule [--name <schedule-name> --uid <uid>] [filters] [flags]
Suspend / Resume Backup Schedule(s)
px pxb suspend backupschedule [filters] [flags]
px pxb resume backupschedule [filters] [flags]
Examples
Create a Daily Schedule for Namespaces
px pxb create backupschedule \
--name daily-sched \
--cluster prod \
--schedule-policy-name daily-8am \
--backup-location-name s3-primary \
--namespace "app1,app2"
Create a Label-Selected Schedule
px pxb create backupschedule \
--name team-sched \
--cluster prod \
--schedule-policy-name hourly \
--backup-location-name s3-primary \
--ns-label-selectors "team=platform"
Create a VirtualMachine Backup Schedule with Specific Resources
px pxb create backupschedule \
--name vm-backup-sched \
--cluster vm-cluster \
--schedule-policy-name daily-8am \
--backup-location-name nfs-backup \
--backup-object-type VirtualMachine \
--namespaces default \
--include-resources "vm1:default:kubevirt.io:v1:VirtualMachine,vm2:default:kubevirt.io:v1:VirtualMachine"
Update a Single Schedule
# Update schedule policy for a specific schedule
px pxb update backupschedule \
--name daily-sched \
--uid schedule-12345 \
--policy-name new-policy \
--policy-uid policy-456
# Suspend a specific schedule
px pxb update backupschedule \
--name daily-sched \
--uid schedule-12345 \
--suspend true
Bulk Update Schedules
# Bulk update all schedules to use a new policy
px pxb update backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "*" \
--policy-name new-policy
# Bulk suspend schedules matching a pattern
px pxb update backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "prod-*" \
--suspend true
# Bulk update specific schedules by name:uid
px pxb update backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-objects "schedule1:uid1,schedule2:uid2" \
--policy-name maintenance-policy
# Bulk update with exclude filter
px pxb update backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "*" \
--exclude-filter "*test*" \
--suspend false
# Bulk update with name-only policy reference (relaxed UID check)
px pxb update backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "*" \
--policy-refs "new-policy" \
--bulk-uid-check-relaxation
Suspend and Resume
# Suspend a specific schedule
px pxb suspend backupschedule --name daily-sched --uid schedule-12345
# Resume a specific schedule
px pxb resume backupschedule --name daily-sched --uid schedule-12345
# Bulk suspend across all clusters for all object types
px pxb suspend backupschedule --backup-object-type All --cluster-scope All --include-filter "*"
# Bulk resume schedules matching a pattern in a cluster
px pxb resume backupschedule --backup-object-type All --cluster-scope prod --include-filter "daily-"
# Suspend schedules using name-only policy reference (relaxed UID check)
px pxb suspend backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "*" \
--policy-refs "maintenance-policy" \
--bulk-uid-check-relaxation
# Resume with remark
px pxb resume backupschedule \
--name daily-sched \
--uid schedule-12345 \
--remark "Resuming after maintenance window"
Note: Suspend and resume operations preserve all schedule configuration including namespaces, label selectors, backup location, CSI snapshot class mappings, exec rules, and all other settings. Only the suspend state is modified.
Delete Schedules with Filters
# Bulk delete across all clusters for all object types (match all)
px pxb delete backupschedule --backup-object-type All --cluster-scope All --include-filter "*"
# Delete schedules using name-only policy reference (relaxed UID check)
px pxb delete backupschedule \
--backup-object-type All \
--cluster-scope All \
--include-filter "*" \
--policy-refs "old-policy" \
--bulk-uid-check-relaxation
Create from file
px pxb create backupschedule --file /path/to/backupschedule-create.json
{
"createMetadata": { "name": "daily-sched" },
"schedulePolicyRef": { "name": "daily-8am" },
"backupLocationRef": { "name": "s3-primary" },
"clusterRef": { "name": "prod" },
"namespaces": ["app1", "app2"]
}
Flags for commands and sub-commands
Create Backup Schedule Flags
Required Flags
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the backup schedule (required, optional with --file) |
--schedule-policy-name | string | Name of the schedule policy (required, optional with --file) | |
--backup-location-name | string | Name of the backup location (required, optional with --file) | |
--cluster | -c | string | Name of the cluster (required, optional with --file) |
Optional Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--uid | string | UID of the backup schedule (optional) | |
--schedule-policy-uid | string | UID of the schedule policy | |
--backup-location-uid | string | UID of the backup location | |
--cluster-uid | string | UID of the cluster |
Resource Selection
| Flag | Short | Type | Description |
|---|---|---|---|
--namespace | []string | Namespaces to back up (comma-separated) | |
--namespaces-file | string | YAML/JSON file containing namespaces array | |
--ns-label-selectors | string | Namespace label selectors | |
--label-selectors | map | Resource label selectors (key=value,key2=value2) | |
--label-selectors-file | string | YAML/JSON file with label selectors | |
--advanced-resource-label-selector | string | Advanced selector (supports operators) | |
--resource-types | []string | Resource kinds to include | |
--resource-types-file | string | YAML/JSON file with resource types | |
--exclude-resource-types | []string | Resource kinds to exclude | |
--exclude-resource-types-file | string | YAML/JSON file with excluded resource types | |
--include-resources | string | Specific resources to include (name:namespace:group:version:kind list, comma-separated) | |
--include-resources-file | string | YAML/JSON file with specific resources to include |
Execution Rules and Behavior
| Flag | Short | Type | Description |
|---|---|---|---|
--pre-exec-rule-name | string | Pre-execution rule name | |
--pre-exec-rule-uid | string | Pre-execution rule UID | |
--post-exec-rule-name | string | Post-execution rule name | |
--post-exec-rule-uid | string | Post-execution rule UID | |
--skip-vm-auto-exec-rules | bool | Skip automatic execution rules for VM backups | |
--parallel-backup | bool | Enable parallel backups | |
--direct-kdmp | bool | Use direct KDMP for data movement | |
--keep-cr-status | bool | Include custom resource status |
Storage and Snapshots
| Flag | Short | Type | Description |
|---|---|---|---|
--csi-snapshot-mapping | map | provisioner=volumesnapshotclass mapping | |
--volume-snapshot-class-mapping-file | string | YAML/JSON file with snapshot class mapping | |
--volume-resource-only-policy-name | string | Name of volume resource only policy | |
--volume-resource-only-policy-uid | string | UID of volume resource only policy |
Policies and Types
| Flag | Short | Type | Description |
|---|---|---|---|
--backup-object-type | string | All (default), VirtualMachine, or NS |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | string | YAML/JSON file with complete schedule specification |
Get Backup Schedule Flags
Resource Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule to inspect (required for inspect; omit to list all) |
--uid | -u | string | UID of the schedule (optional; used with --name) |
Filtering
| Flag | Short | Type | Description |
|---|---|---|---|
--backup-location-name | string | Filter by backup location name | |
--backup-location-uid | string | Filter by backup location UID | |
--backup-object-type | string | Filter by backup object type: All, VirtualMachine, or NS |
Advanced Filtering
| Flag | Short | Type | Description |
|---|---|---|---|
--include-objects | []string | Include specific schedules by name | |
--exclude-objects | []string | Exclude specific schedules by name | |
--include-filter | string | Include filter expression | |
--exclude-filter | string | Exclude filter expression | |
--policy-refs | []string | Filter by schedule policy references | |
--cluster-scope | string | Cluster scope: All or name[:uid][,name2[:uid2]...] |
Listing and Display
| Flag | Short | Type | Description |
|---|---|---|---|
--max-objects | uint64 | Maximum number of schedules to retrieve (0 for no limit) | |
--sort-by | string | Sort by: name, create_time, update_time, cluster | |
--sort-order | string | asc or desc (default: asc) | |
--detailed | bool | Show detailed schedule information |
Update Backup Schedule Flags
Single Update Mode - Required Identification
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the schedule to update (required for single update) |
--uid | -u | string | UID of the schedule to update (required for single update) |
Bulk Update Mode - Required Filters
| Flag | Short | Type | Description |
|---|---|---|---|
--backup-object-type | string | Backup object type (required for bulk update; valid values: NS, VM, All) | |
--cluster-scope | string | Cluster scope (required for bulk update; valid values: All or name[:uid][,name2[:uid2]...]) | |
--include-filter | string | Include filter regex pattern (required for bulk update; use * to match all within scope; mutually exclusive with --include-objects) |
Bulk Update Mode - Optional Filters
| Flag | Short | Type | Description |
|---|---|---|---|
--include-objects | strings | Include specific backup schedules by name or name:uid (comma-separated; mutually exclusive with --include-filter) | |
--exclude-objects | strings | Exclude specific backup schedules by name or name:uid (comma-separated; mutually exclusive with --exclude-filter) | |
--exclude-filter | string | Exclude filter regex pattern (mutually exclusive with --exclude-objects) | |
--policy-refs | strings | Policy references for bulk update (name or name:uid) |
Update Fields (Both Modes)
| Flag | Short | Type | Description |
|---|---|---|---|
--policy-name | string | New schedule policy name | |
--policy-uid | string | New schedule policy UID | |
--pre-exec-rule-name | string | Pre-execution rule name | |
--pre-exec-rule-uid | string | Pre-execution rule UID | |
--post-exec-rule-name | string | Post-execution rule name | |
--post-exec-rule-uid | string | Post-execution rule UID | |
--label-selectors | map | Update resource label selectors | |
--csi-snapshot-mapping | map | Update CSI snapshot class mapping | |
--parallel-backup | bool | Enable/disable parallel backups | |
--suspend | string | Suspend the schedule: true or false |
File Input
| Flag | Short | Type | Description |
|---|---|---|---|
--file | string | YAML/JSON with complete update configuration (skips validation) | |
--label-selectors-file | string | YAML/JSON file with label selectors | |
--volume-snapshot-class-mapping-file | string | YAML/JSON file with snapshot class mapping | |
--include-objects-file | string | YAML/JSON file containing include objects list | |
--exclude-objects-file | string | YAML/JSON file containing exclude objects list | |
--policy-refs-file | string | YAML/JSON file containing policy references list |
Bulk Operation Options
| Flag | Short | Type | Description |
|---|---|---|---|
--bulk-uid-check-relaxation | bool | Relax UID check for bulk operations when using name-only references (e.g., policy-refs with name only). When enabled, allows filtering by object names without requiring UIDs, accepting potential side effects if multiple objects share the same name. |
Delete Backup Schedule Flags
Identification (single deletion)
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the backup schedule to delete (required for single deletion) |
--uid | -u | string | UID of the backup schedule (optional) |
Bulk Filters
| Flag | Short | Type | Description |
|---|---|---|---|
--include-objects | []string | Include schedules by name | |
--exclude-objects | []string | Exclude schedules by name | |
--include-filter | string | Include filter expression | |
--exclude-filter | string | Exclude filter expression | |
--backup-object-type | string | Required for bulk: All, VirtualMachine, or NS | |
--policy-refs | []string | Filter by schedule policy references | |
--cluster-scope | string | Cluster scope: All or name[:uid][,name2[:uid2]...] |
Deletion Behavior
| Flag | Short | Type | Description |
|---|---|---|---|
--force | bool | Force deletion even if the schedule is in use |
Bulk Operation Options
| Flag | Short | Type | Description |
|---|---|---|---|
--bulk-uid-check-relaxation | bool | Relax UID check for bulk operations when using name-only references (e.g., policy-refs with name only). When enabled, allows filtering by object names without requiring UIDs, accepting potential side effects if multiple objects share the same name. |
Suspend Backup Schedule Flags
Identification (single suspension)
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the backup schedule to suspend (required for single suspension) |
--uid | -u | string | UID of the backup schedule (optional) |
Bulk Filters
| Flag | Short | Type | Description |
|---|---|---|---|
--include-objects | []string | Include schedules by name | |
--exclude-objects | []string | Exclude schedules by name | |
--include-filter | string | Include filter expression | |
--exclude-filter | string | Exclude filter expression | |
--backup-object-type | string | Required for bulk: All, VirtualMachine, or NS | |
--policy-refs | []string | Filter by schedule policy references | |
--cluster-scope | string | Cluster scope: All or name[:uid][,name2[:uid2]...] |
Important: Bulk suspend does not accept
--name. Use the Bulk Filters above and set--backup-object-type.
File Input (suspend)
| Flag | Short | Type | Description |
|---|---|---|---|
--file | string | YAML/JSON API request for bulk suspend | |
--include-objects-file | string | YAML/JSON list of names to include | |
--exclude-objects-file | string | YAML/JSON list of names to exclude | |
--policy-refs-file | string | YAML/JSON list of policy references |
Bulk Operation Options (suspend)
| Flag | Short | Type | Description |
|---|---|---|---|
--bulk-uid-check-relaxation | bool | Relax UID check for bulk operations when using name-only references (e.g., policy-refs with name only). When enabled, allows filtering by object names without requiring UIDs, accepting potential side effects if multiple objects share the same name. |
Resume Backup Schedule Flags
Identification (single resumption)
| Flag | Short | Type | Description |
|---|---|---|---|
--name | -n | string | Name of the backup schedule to resume (required for single resumption) |
--uid | -u | string | UID of the backup schedule (optional) |
Bulk Filters
| Flag | Short | Type | Description |
|---|---|---|---|
--include-objects | []string | Include schedules by name | |
--exclude-objects | []string | Exclude schedules by name | |
--include-filter | string | Include filter expression | |
--exclude-filter | string | Exclude filter expression | |
--backup-object-type | string | Required for bulk: All, VirtualMachine, or NS | |
--policy-refs | []string | Filter by schedule policy references | |
--cluster-scope | string | Cluster scope: All or name[:uid][,name2[:uid2]...] |
File Input (resume)
| Flag | Short | Type | Description |
|---|---|---|---|
--file | string | YAML/JSON API request for bulk resume | |
--include-objects-file | string | YAML/JSON list of names to include | |
--exclude-objects-file | string | YAML/JSON list of names to exclude | |
--policy-refs-file | string | YAML/JSON list of policy references |
Bulk Operation Options (resume)
| Flag | Short | Type | Description |
|---|---|---|---|
--bulk-uid-check-relaxation | bool | Relax UID check for bulk operations when using name-only references (e.g., policy-refs with name only). When enabled, allows filtering by object names without requiring UIDs, accepting potential side effects if multiple objects share the same name. |
Notes
- Get dual mode: without
--nameenumerates; with--nameinspects one (optionally add--uid). - Create: when not using
--file,--schedule-policy-name,--backup-location-name, and--clusterare required. - Update: when not using
--file, both--nameand--uidare required. With--file, identifiers may come from the file; CLI flags override file values. - Delete: choose either single deletion (
--namerequired;--uidoptional) or bulk filters; do not mix single and bulk flags. - Suspend/Resume: choose single or bulk; do not mix. For bulk,
--backup-object-typeis required (valid:All,VirtualMachine,NS).--include-objectsis mutually exclusive with--include-filter, and--exclude-objectswith--exclude-filter. - Precedence: CLI flags override granular
*-fileinputs, which override--file. - Include Resources: Use
--include-resourcesto specify individual resources to back up. Format:name:namespace:group:version:kind(comma-separated for multiple resources). Mutually exclusive with--include-resources-file. When using--include-resourcesfor VirtualMachine backups, it's recommended to also specify--namespacesto avoid server-side errors.
Bulk Operation Rules (delete/suspend/resume/update)
- Bulk mode is triggered only when any of these are set:
--include-objects,--exclude-objects,--include-filter, or--exclude-filter. - In bulk mode, all of the following are REQUIRED:
--backup-object-type(valid:All,VirtualMachine,NS)--cluster-scope(valid:Allorname[:uid][,name2[:uid2]...])--include-filter(provide a simple prefix/substring; regex like.*is not required. Example: usedaily-to matchdaily-backup. Use*to match all within the specified scope)
- Mutual exclusivity:
- Do not specify both
--include-objectsand--include-filter - Do not specify both
--exclude-objectsand--exclude-filter - Do not specify both
--include-filterand--exclude-filter
- Do not specify both
- Do not mix single-mode flags (
--name,--uid) with bulk-mode flags. - Bulk UID Check Relaxation: By default, bulk operations require UIDs for object references (e.g.,
--include-objects,--exclude-objects,--policy-refs). Use--bulk-uid-check-relaxationto allow name-only references when you accept the potential side effects of matching multiple objects with the same name across different organizations or contexts. This is particularly useful when filtering by policy references without looking up UIDs.
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