Scheduling
Automate your backups with cron-based scheduling.
Overview
DBackup uses standard cron expressions for scheduling. When a schedule is set, the job runs automatically at the specified times.
Cron Expression Format
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *Common Schedules
Daily Backups
# Every day at 2:00 AM
0 2 * * *
# Every day at midnight
0 0 * * *
# Every day at 6:00 PM
0 18 * * *Multiple Times Per Day
# Every 6 hours
0 */6 * * *
# Every 4 hours
0 */4 * * *
# Every hour
0 * * * *
# Twice a day (6 AM and 6 PM)
0 6,18 * * *Weekly Backups
# Every Sunday at 3:00 AM
0 3 * * 0
# Every Saturday at midnight
0 0 * * 6
# Monday, Wednesday, Friday at 2:00 AM
0 2 * * 1,3,5Monthly Backups
# First day of month at 4:00 AM
0 4 1 * *
# Last day of month at midnight (approximation)
0 0 28-31 * *
# 15th of every month
0 0 15 * *Specific Schedules
# Weekdays at 1:00 AM
0 1 * * 1-5
# Weekends at 6:00 AM
0 6 * * 0,6
# Every 30 minutes during business hours
*/30 9-17 * * 1-5Schedule Examples by Use Case
Production Database (Critical)
Multiple backups per day:
# Every 4 hours
0 */4 * * *Combined with Smart retention for long-term keeping.
Development Database
Daily is usually sufficient:
# Daily at 3:00 AM
0 3 * * *Large Database (Time-Sensitive)
Schedule during maintenance window:
# Sunday 2:00 AM (low traffic)
0 2 * * 0Compliance (Financial)
End of business day:
# Weekdays at 11:00 PM
0 23 * * 1-5Time Zone
DBackup uses the server's time zone. In Docker:
services:
dbackup:
environment:
- TZ=Europe/BerlinCommon time zones:
UTC- Coordinated Universal TimeEurope/Berlin- Central European TimeAmerica/New_York- Eastern TimeAmerica/Los_Angeles- Pacific TimeAsia/Tokyo- Japan Standard Time
Scheduler Behavior
Startup
When DBackup starts:
- Loads all active jobs
- Calculates next run times
- Registers with scheduler
Execution
When scheduled time arrives:
- Job is queued
- Respects concurrency limit
- Executes when slot available
Missed Schedules
If DBackup was down during scheduled time:
- Missed runs are not automatically triggered
- Next run occurs at next scheduled time
- Consider running manually after downtime
Best Practices
Stagger Schedules
Don't run all jobs at same time:
# Job 1: 2:00 AM
0 2 * * *
# Job 2: 2:30 AM
30 2 * * *
# Job 3: 3:00 AM
0 3 * * *Off-Peak Hours
Run during low-traffic periods:
- Night time (1-5 AM)
- Weekends for large backups
- After business hours
Match Retention Policy
Align schedule with retention:
- Daily backups → Keep 7-30 daily
- Weekly backups → Keep 4-12 weekly
- Monthly backups → Keep 12-24 monthly
Consider Database Load
- Production: Multiple times per day
- Staging: Daily
- Development: Daily or weekly
Monitoring Schedules
View Next Run
In the Jobs list, see "Next Run" column showing when each job will execute.
Execution History
Check History to verify:
- Jobs ran at expected times
- No missed executions
- Duration is consistent
Notifications
Set up notifications to alert on:
- Failures (always recommended)
- Successful completions (optional)
Troubleshooting
Job Not Running on Schedule
- Verify job is Enabled
- Check cron expression syntax
- Confirm time zone is correct
- Check DBackup logs for errors
- Verify scheduler is running
Runs at Wrong Time
- Check server time zone
- Set TZ environment variable
- Restart DBackup after TZ change
Overlapping Executions
If backups overlap:
- Increase time between schedules
- Reduce backup duration (compression)
- Increase max concurrent jobs
Cron Expression Generator
Use online tools to generate complex expressions:
Examples
Enterprise Backup Strategy
# Hourly incremental (if supported)
0 * * * *
# Daily full backup at 2 AM
0 2 * * *
# Weekly full to archive at 3 AM Sunday
0 3 * * 0
# Monthly to cold storage
0 4 1 * *Small Business
# Daily backup at 1 AM
0 1 * * *
# Weekly comprehensive at 2 AM Sunday
0 2 * * 0Development Team
# Before daily standup (9 AM)
0 9 * * 1-5
# End of week archive
0 18 * * 5Next Steps
- Retention Policies - Automatic cleanup
- Notifications - Get alerts
- Creating Jobs - Job configuration