Scheduled Backups
Automate backups with cron-based scheduling.
Automate your backup strategy with scheduled backups using cron expressions.
Create Scheduled Backup
Via Web UI
- Navigate to Tasks
- Click New Task
- Select type: Backup
- Configure:
- Name: "Daily Production Backup"
- Project: Select project
- Backup type: Full/Database/etc.
- Destination: Local or cloud
- Schedule: Enter cron expression
- Click Create Task
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 Production Backup",
"enabled": true,
"type": "backup",
"projectId": "production",
"cronExpression": "0 2 * * *",
"timezone": "America/New_York",
"backupConfig": {
"type": "full",
"destination": "s3",
"encrypt": true
}
}'
Cron Expression Format
┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday = 0) │ │ │ │ │ * * * * *
Common Schedules
| Schedule | Cron Expression | Description |
|---|---|---|
| Every hour | 0 * * * * | At minute 0 of every hour |
| Daily at 2 AM | 0 2 * * * | Every day at 2:00 AM |
| Daily at midnight | 0 0 * * * | Every day at midnight |
| Twice daily | 0 2,14 * * * | At 2 AM and 2 PM |
| Weekly (Sunday) | 0 2 * * 0 | Sunday at 2 AM |
| Weekly (Monday) | 0 2 * * 1 | Monday at 2 AM |
| Monthly | 0 2 1 * * | 1st of month at 2 AM |
| Quarterly | 0 2 1 1,4,7,10 * | 1st of Jan, Apr, Jul, Oct |
Timezone
Specify timezone for schedule:
{
"cronExpression": "0 2 * * *",
"timezone": "America/New_York"
}
Common timezones:
UTCAmerica/New_YorkAmerica/Los_AngelesEurope/LondonEurope/ParisAsia/Tokyo
Recommended Backup Schedules
Production Environment
[
{
"name": "Daily Full Backup",
"cronExpression": "0 2 * * *",
"backupConfig": { "type": "full", "destination": "s3" }
},
{
"name": "Hourly Database Backup",
"cronExpression": "0 * * * *",
"backupConfig": { "type": "database", "destination": "local" }
}
]
Staging Environment
{
"name": "Weekly Staging Backup",
"cronExpression": "0 3 * * 0",
"backupConfig": { "type": "full", "destination": "local" }
}
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 Production Backup",
"type": "backup",
"enabled": true,
"cronExpression": "0 2 * * *",
"timezone": "America/New_York",
"nextRun": "2026-01-20T07:00:00Z",
"lastRun": "2026-01-19T07:00:00Z",
"lastStatus": "success"
}
]
}
Enable/Disable Schedule
Enable
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 '{"enabled": true}'
Disable
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 '{"enabled": false}'
Run Backup Immediately
Trigger scheduled backup now:
curl -X POST https://supascale.example.com/api/v1/tasks/task-456/run \ -H "X-API-Key: your-api-key"
View Backup History
Check execution history:
curl https://supascale.example.com/api/v1/tasks/task-456 \ -H "X-API-Key: your-api-key"
Response includes recent executions:
{
"id": "task-456",
"name": "Daily Production Backup",
"history": [
{
"executedAt": "2026-01-19T07:00:00Z",
"status": "success",
"duration": 120,
"backupId": "backup-789"
},
{
"executedAt": "2026-01-18T07:00:00Z",
"status": "success",
"duration": 115,
"backupId": "backup-788"
}
]
}
Retention Policies
Implement retention by scheduling cleanup:
Via Tasks (Manual Cleanup)
Create a task to delete old backups:
{
"name": "Cleanup Old Backups",
"type": "custom",
"cronExpression": "0 4 * * *",
"customConfig": {
"script": "cleanup-backups",
"args": ["--older-than", "30d"]
}
}
Best Practices
- Daily backups: Keep 7 days
- Weekly backups: Keep 4 weeks
- Monthly backups: Keep 12 months
- Store in cloud: For disaster recovery
Monitoring Backups
Email Notifications
Configure SMTP to receive backup notifications:
- Set up SMTP in Supascale settings
- Enable notifications for backup tasks
Check Backup Status
Monitor via API:
# Get recent backup tasks curl "https://supascale.example.com/api/v1/tasks?type=backup" \ -H "X-API-Key: your-api-key"
Look for:
lastStatus: success/failurelastRun: When it last rannextRun: When it will run next
Troubleshooting
Backup Didn't Run
- Verify task is enabled
- Check cron expression is valid
- Verify timezone is correct
- Check Supascale logs
Backup Failed
- Check disk space
- Verify project is running
- Check cloud storage credentials
- Review task execution logs
Backups Running Too Slowly
- Schedule during low-traffic periods
- Use database-only backups more frequently
- Check disk I/O performance