Scheduled Backups
Automate backups with BackupSchedule and cron.
Basic BackupSchedule
apiVersion: retour.thebackup.company/v1
kind: BackupSchedule
metadata:
name: daily-backup
spec:
schedule: "0 2 * * *" # 2 AM daily (cron)
storageBackend: s3-production
namespacedResources:
- resourceType: Deployment
namespace: production
name: webapp
successfulBackupsHistoryLimit: 7
Cron Schedule Format
Standard 5-field cron:
| Field | Values |
|---|---|
| Minute | 0-59 |
| Hour | 0-23 |
| Day of month | 1-31 |
| Month | 1-12 |
| Day of week | 0-7 (0 and 7 = Sunday) |
Examples:
0 2 * * *— 2 AM daily0 */6 * * *— Every 6 hours0 0 * * 0— Midnight every Sunday30 3 1 * *— 3:30 AM on the 1st of each month
Concurrency Policy
When a scheduled run would overlap with an existing backup:
| Policy | Behavior |
|---|---|
| Allow | Create new backup (default) |
| Forbid | Skip this run, wait for next schedule |
| Replace | Delete active backup, create new one |
Retention
- successfulBackupsHistoryLimit: Keep last N successful backups (default: 3)
- failedBackupsHistoryLimit: Keep last N failed backups (default: 1)
Older backups are deleted when the limit is exceeded.
Suspend a Schedule
Pause without deleting:
Resume:
Validation (Webhook)
When the BackupSchedule webhook is enabled, invalid cron expressions are rejected at admission time: