Skip to main content

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

FrequencyFields RequiredDescription
HourlyminuteRuns every hour at the specified minute
Dailyhour, minuteRuns every day at the specified time (UTC)
Weeklyhour, minute, day_of_weekRuns once a week
Monthlyhour, minute, day_of_monthRuns once a month

Time Fields

FieldRangeDescription
hour0–23Hour of day (UTC)
minute0–59Minute of hour
day_of_week0–6Monday=0, Sunday=6 (weekly only)
day_of_month1–28Day 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 CountEffect
7Keep last 7 scheduled backups
30Keep last 30 scheduled backups
365Maximum: 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:

FieldDescription
last_run_atWhen the schedule last executed
next_run_atNext scheduled execution time
last_run_statussuccess, failed, or skipped
is_activeWhether the schedule is enabled

Best Practices

PracticeDescription
Schedule during off-peakRun backups at low-traffic hours (e.g., 3 AM UTC)
Set appropriate retentionBalance data safety vs. storage costs
Monitor failuresCheck last_run_status regularly
Use multiple frequenciesDaily + weekly for layered protection

Next Steps