Backup Schedules

Automate backups with scheduled tasks.

Create automated backup schedules for consistent data protection.

Create Backup Schedule

Via Web UI

  1. Navigate to Tasks
  2. Click New Task
  3. Select type: Backup
  4. Configure backup settings
  5. Set schedule
  6. 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

OptionValuesDescription
typefull, database, storage, functions, configWhat to backup
destinationlocal, s3, gcs, azure, r2, minio, backblazeWhere to store
encrypttrue, falseEncrypt backup

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

ScheduleCron Expression
Every hour0 * * * *
Every 6 hours0 */6 * * *
Daily at 2 AM0 2 * * *
Daily at midnight0 0 * * *
Twice daily0 2,14 * * *
Weekly Sunday 3 AM0 3 * * 0
Monthly 1st at 2 AM0 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

  1. Low traffic periods - Schedule during off-peak hours
  2. Stagger backups - Don't run all at same time
  3. Consider timezones - Use appropriate timezone

Retention Strategy

TypeFrequencyRetention
DatabaseHourly24 hours
DatabaseDaily7 days
FullWeekly4 weeks
FullMonthly12 months

Monitoring

  1. Check task status regularly
  2. Set up failure alerts
  3. Verify backup integrity periodically
  4. Test restores monthly

Troubleshooting

Backup Not Running

  1. Verify task is enabled
  2. Check cron expression is valid
  3. Verify timezone
  4. Check Supascale logs

Backup Failing

  1. Check disk space
  2. Verify project is running
  3. Check cloud storage credentials
  4. Review task history for errors