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 |