Scheduled Backups
Configure automated backup schedules with retention policies.
Creating a Schedule
curl -X POST https://api.lordbase.com/e/v1/developer/databases/{database_id}/schedules/ \
-H "Authorization: Bearer lb_pat_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Nightly backup",
"frequency": "daily",
"hour": 3,
"minute": 0,
"retention_count": 7
}'
Frequency Options
| Frequency | Fields Required | Description |
|---|---|---|
| Hourly | minute | Runs every hour at the specified minute |
| Daily | hour, minute | Runs every day at the specified time (UTC) |
| Weekly | hour, minute, day_of_week | Runs once a week |
| Monthly | hour, minute, day_of_month | Runs once a month |
Time Fields
| Field | Range | Description |
|---|---|---|
hour | 0–23 | Hour of day (UTC) |
minute | 0–59 | Minute of hour |
day_of_week | 0–6 | Monday=0, Sunday=6 (weekly only) |
day_of_month | 1–28 | Day of month, capped at 28 (monthly only) |
Retention Policies
The retention_count controls how many scheduled backups are kept. Older backups beyond this limit are automatically deleted.
| Retention Count | Effect |
|---|---|
7 | Keep last 7 scheduled backups |
30 | Keep last 30 scheduled backups |
365 | Maximum: keep up to 365 backups |
tip
Manual backups are not affected by retention policies. Only scheduled backups are auto-cleaned.
Managing Schedules
List Schedules
curl -X GET https://api.lordbase.com/e/v1/developer/databases/{database_id}/schedules/ \
-H "Authorization: Bearer lb_pat_your_token"
Update a Schedule
curl -X PUT https://api.lordbase.com/e/v1/developer/schedules/{schedule_id}/ \
-H "Authorization: Bearer lb_pat_your_token" \
-H "Content-Type: application/json" \
-d '{"frequency": "weekly", "day_of_week": 0, "hour": 2}'
Pause a Schedule
curl -X PUT https://api.lordbase.com/e/v1/developer/schedules/{schedule_id}/ \
-H "Authorization: Bearer lb_pat_your_token" \
-H "Content-Type: application/json" \
-d '{"is_active": false}'
Manually Trigger
Force a scheduled backup to run immediately:
curl -X POST https://api.lordbase.com/e/v1/developer/schedules/{schedule_id}/trigger/ \
-H "Authorization: Bearer lb_pat_your_token"
Delete a Schedule
curl -X DELETE https://api.lordbase.com/e/v1/developer/schedules/{schedule_id}/ \
-H "Authorization: Bearer lb_pat_your_token"
Schedule Status
Each schedule tracks its run history:
| Field | Description |
|---|---|
last_run_at | When the schedule last executed |
next_run_at | Next scheduled execution time |
last_run_status | success, failed, or skipped |
is_active | Whether the schedule is enabled |
Best Practices
| Practice | Description |
|---|---|
| Schedule during off-peak | Run backups at low-traffic hours (e.g., 3 AM UTC) |
| Set appropriate retention | Balance data safety vs. storage costs |
| Monitor failures | Check last_run_status regularly |
| Use multiple frequencies | Daily + weekly for layered protection |
Next Steps
- Manual Backups — On-demand backup creation
- Monitoring — Monitor backup status and database health