Backup Schedules
Automate backups with scheduled tasks.
Create automated backup schedules for consistent data protection.
Create Backup Schedule
Via Web UI
- Navigate to Tasks
- Click New Task
- Select type: Backup
- Configure backup settings
- Set schedule
- Click Create
Via API
curl -X POST https://supascale.example.com/api/v1/tasks \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Database Backup",
"enabled": true,
"type": "backup",
"projectId": "production",
"cronExpression": "0 2 * * *",
"timezone": "America/New_York",
"backupConfig": {
"type": "database",
"destination": "s3",
"encrypt": false
}
}'
Backup Configuration Options
| Option | Values | Description |
|---|---|---|
type | full, database, storage, functions, config | What to backup |
destination | local, s3, gcs, azure, r2, minio, backblaze | Where to store |
encrypt | true, false | Encrypt backup |
Recommended Schedules
Production Environment
[
{
"name": "Hourly DB Backup (Local)",
"cronExpression": "0 * * * *",
"backupConfig": {
"type": "database",
"destination": "local"
}
},
{
"name": "Daily Full Backup (S3)",
"cronExpression": "0 2 * * *",
"backupConfig": {
"type": "full",
"destination": "s3",
"encrypt": true
}
},
{
"name": "Weekly Storage Backup (S3)",
"cronExpression": "0 3 * * 0",
"backupConfig": {
"type": "storage",
"destination": "s3"
}
}
]
Staging Environment
{
"name": "Daily Staging Backup",
"cronExpression": "0 4 * * *",
"backupConfig": {
"type": "full",
"destination": "local"
}
}
Development Environment
{
"name": "Weekly Dev Backup",
"cronExpression": "0 0 * * 0",
"backupConfig": {
"type": "database",
"destination": "local"
}
}
Common Cron Schedules
| Schedule | Cron Expression |
|---|---|
| Every hour | 0 * * * * |
| Every 6 hours | 0 */6 * * * |
| Daily at 2 AM | 0 2 * * * |
| Daily at midnight | 0 0 * * * |
| Twice daily | 0 2,14 * * * |
| Weekly Sunday 3 AM | 0 3 * * 0 |
| Monthly 1st at 2 AM | 0 2 1 * * |
View Scheduled Backups
curl "https://supascale.example.com/api/v1/tasks?type=backup" \ -H "X-API-Key: your-api-key"
Response:
{
"tasks": [
{
"id": "task-456",
"name": "Daily Full Backup",
"type": "backup",
"enabled": true,
"projectId": "production",
"cronExpression": "0 2 * * *",
"nextRun": "2026-01-20T07:00:00Z",
"lastRun": "2026-01-19T07:00:00Z",
"lastStatus": "success"
}
]
}
Manage Schedules
Update Schedule
curl -X PUT https://supascale.example.com/api/v1/tasks/task-456 \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"cronExpression": "0 3 * * *"
}'
Enable/Disable
# Disable
curl -X PUT https://supascale.example.com/api/v1/tasks/task-456 \
-H "X-API-Key: your-api-key" \
-d '{"enabled": false}'
# Enable
curl -X PUT https://supascale.example.com/api/v1/tasks/task-456 \
-H "X-API-Key: your-api-key" \
-d '{"enabled": true}'
Delete Schedule
curl -X DELETE https://supascale.example.com/api/v1/tasks/task-456 \ -H "X-API-Key: your-api-key"
Run Immediately
Trigger backup now (doesn't affect schedule):
curl -X POST https://supascale.example.com/api/v1/tasks/task-456/run \ -H "X-API-Key: your-api-key"
Execution History
View recent backup executions:
curl https://supascale.example.com/api/v1/tasks/task-456 \ -H "X-API-Key: your-api-key"
Response includes history:
{
"history": [
{
"executedAt": "2026-01-19T07:00:00Z",
"status": "success",
"duration": 120,
"backupId": "backup-789",
"backupSize": 52428800
},
{
"executedAt": "2026-01-18T07:00:00Z",
"status": "success",
"duration": 115,
"backupId": "backup-788",
"backupSize": 51234567
}
]
}
Best Practices
Schedule Timing
- Low traffic periods - Schedule during off-peak hours
- Stagger backups - Don't run all at same time
- Consider timezones - Use appropriate timezone
Retention Strategy
| Type | Frequency | Retention |
|---|---|---|
| Database | Hourly | 24 hours |
| Database | Daily | 7 days |
| Full | Weekly | 4 weeks |
| Full | Monthly | 12 months |
Monitoring
- Check task status regularly
- Set up failure alerts
- Verify backup integrity periodically
- Test restores monthly
Troubleshooting
Backup Not Running
- Verify task is enabled
- Check cron expression is valid
- Verify timezone
- Check Supascale logs
Backup Failing
- Check disk space
- Verify project is running
- Check cloud storage credentials
- Review task history for errors