Scheduled Backups

Automate backups with cron-based scheduling.

Automate your backup strategy with scheduled backups using cron expressions.

Create Scheduled Backup

Via Web UI

  1. Navigate to Tasks
  2. Click New Task
  3. Select type: Backup
  4. Configure:
    • Name: "Daily Production Backup"
    • Project: Select project
    • Backup type: Full/Database/etc.
    • Destination: Local or cloud
    • Schedule: Enter cron expression
  5. 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

ScheduleCron ExpressionDescription
Every hour0 * * * *At minute 0 of every hour
Daily at 2 AM0 2 * * *Every day at 2:00 AM
Daily at midnight0 0 * * *Every day at midnight
Twice daily0 2,14 * * *At 2 AM and 2 PM
Weekly (Sunday)0 2 * * 0Sunday at 2 AM
Weekly (Monday)0 2 * * 1Monday at 2 AM
Monthly0 2 1 * *1st of month at 2 AM
Quarterly0 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:

  • UTC
  • America/New_York
  • America/Los_Angeles
  • Europe/London
  • Europe/Paris
  • Asia/Tokyo

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

  1. Daily backups: Keep 7 days
  2. Weekly backups: Keep 4 weeks
  3. Monthly backups: Keep 12 months
  4. Store in cloud: For disaster recovery

Monitoring Backups

Email Notifications

Configure SMTP to receive backup notifications:

  1. Set up SMTP in Supascale settings
  2. 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/failure
  • lastRun: When it last ran
  • nextRun: When it will run next

Troubleshooting

Backup Didn't Run

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

Backup Failed

  1. Check disk space
  2. Verify project is running
  3. Check cloud storage credentials
  4. Review task execution logs

Backups Running Too Slowly

  1. Schedule during low-traffic periods
  2. Use database-only backups more frequently
  3. Check disk I/O performance