Setting Up Automated Backups
Never forget to backup again. Set up automated snapshots with timers to protect your data automatically
The Story: When "I'll Do It Later" Becomes a Problem
Meet Taylor, a developer who knows backups are important but often forgets to create them regularly. Taylor's workflow involves frequent database changes, and while the intention to backup is always there, the execution often falls through the cracks.
โฐ Monday, 9:00 AM - The Good Intention
Taylor starts working on a new feature. "I should backup the database before I start," Taylor thinks. But there's a meeting in 10 minutes, and the backup can wait. "I'll do it after the meeting."
โฐ Monday, 2:00 PM - The Busy Day
After the meeting, Taylor gets pulled into fixing a critical bug. The backup is forgotten. The day gets busier, and by 5 PM, Taylor has made significant database changes but still no backup.
"I'll backup tomorrow morning," Taylor thinks.
โฐ Tuesday, 10:00 AM - The Disaster
Tuesday morning, Taylor continues working. A migration script has a bug, and the database gets corrupted. Taylor needs to restore from a backup, but the last backup was from last Thursdayโ4 days ago.
All of Monday's work is lost. Taylor has to:
- Restore from the old backup
- Recreate all the work from Monday
- Explain to the team why the feature is delayed
- Deal with the frustration of lost work
The Lesson
Manual backups rely on human memory, which is unreliable. Even the most disciplined developers forget. Automated backups with timers ensure your data is protected consistently, without relying on remembering to do it manually.
Why Automated Backups Matter
Never Forget Again
Set it once, and backups happen automatically. No more relying on memory or sticky notes. Your data is protected on a schedule you define.
Consistent Protection
Automated backups ensure regular snapshots, creating a reliable timeline of your database states. Whether it's daily, hourly, or weekly, you'll always have recent backups available.
Peace of Mind
Work confidently knowing that even if you forget to backup, your automated system has you covered. Focus on development, not backup reminders.
Recovery Points
With regular automated backups, you have multiple recovery points. If something goes wrong, you can restore to any point in your backup timeline, not just the last manual backup.
How to Set Up Automated Backups
Create a Backup Flow
First, create a backup flow that defines what gets backed up:
- Open Quemsi web UI
- Navigate to "Flows"
- Click "Create Backup Flow"
- Select your datasource (the database to backup)
- Select your storage destination
- Configure any processing steps (e.g., compression)
- Save the flow with a descriptive name like
daily-backup-production
# Example: Create backup flow via API
quemsi flow create \
--type backup \
--name "daily-backup-production" \
--datasource prod_db \
--storage prod_backup_storage \
--processing zip
Create a Timer
Now create a timer that defines when the backup should run:
- Navigate to "Timers" in Quemsi web UI
- Click "Create Timer"
- Choose your schedule:
- Daily: Every day at a specific time
- Weekly: On specific days of the week
- Hourly: Every hour
- Custom: Cron expression for advanced scheduling
- Set the time (e.g., 2:00 AM daily)
- Save the timer with a name like
daily-2am-backup
# Example: Create daily timer (runs at 2 AM)
quemsi timer create \
--name "daily-2am-backup" \
--schedule "0 2 * * *" \
--description "Daily backup at 2 AM"
Link Timer to Flow
Connect the timer to your backup flow:
- Edit your backup flow
- Add the timer you created
- Configure automatic tagging (optional):
- Tag format:
auto-daily-{date} - This helps identify automated backups in the timeline
- Tag format:
- Save the flow
Your automated backup is now set up! It will run automatically according to your schedule.
Verify It Works
After setting up, verify your automated backup:
- Wait for the first scheduled run (or trigger it manually for testing)
- Check the "Data" section in Quemsi
- Look for the new backup with your automatic tag
- Verify it completed successfully
Once verified, you can rely on automated backups running on schedule.
Recommended Backup Schedules
๐ Production Database
Schedule: Daily at 2:00 AM
Why: Low-traffic time, ensures daily recovery point
Tag format: auto-daily-{YYYY-MM-DD}
Retention: Keep last 30 days, then weekly for 3 months
๐ Development Database
Schedule: Every 6 hours
Why: Frequent changes, need multiple recovery points
Tag format: auto-dev-{YYYY-MM-DD-HH}
Retention: Keep last 7 days
๐ Test/Staging Database
Schedule: Daily at midnight
Why: Regular snapshots for testing scenarios
Tag format: auto-test-{YYYY-MM-DD}
Retention: Keep last 14 days
๐ Critical Feature Development
Schedule: Every 2 hours during work hours
Why: Frequent checkpoints during active development
Tag format: auto-feature-{feature-name}-{timestamp}
Retention: Keep until feature is complete
Best Practices for Automated Backups
๐ท๏ธ Use Consistent Tagging
Configure automatic tags that make it easy to identify automated backups:
auto-daily-{date}- Daily automated backupsauto-hourly-{timestamp}- Hourly automated backupsauto-weekly-{date}- Weekly automated backups
This helps distinguish automated backups from manual ones in your timeline.
โฐ Schedule During Low-Traffic Times
For production databases, schedule backups during low-traffic periods:
- Early morning (2-4 AM) for daily backups
- Weekends for weekly backups
- Avoid peak business hours
This minimizes impact on application performance.
๐ Monitor Backup Success
Set up alerts or regularly check that backups are completing successfully:
- Review backup timeline weekly
- Set up notifications for failed backups
- Verify backup sizes are reasonable (not zero or suspiciously small)
- Test restore process periodically
๐๏ธ Implement Retention Policies
Don't keep backups forever. Set up retention policies:
- Keep daily backups for 30 days
- Keep weekly backups for 3 months
- Keep monthly backups for 1 year
- Automate cleanup of old backups
This saves storage space while maintaining recovery capability.
๐งช Test Your Backups
Regularly verify that your automated backups work:
- Test restore from an automated backup monthly
- Verify data integrity after restore
- Check that all tables and data are present
- Document the restore process
A backup is only as good as your ability to restore from it.
๐ Document Your Backup Strategy
Document your automated backup setup:
- List all automated backup flows and their schedules
- Document retention policies
- Note any special configurations
- Include restore procedures
This helps your team understand the backup strategy and troubleshoot issues.
Real-World Scenarios
Scenario 1: The Forgotten Backup
Problem: Developer forgets to backup before making risky changes. Database gets corrupted, and the last backup is 5 days old.
Solution with Automation: Automated daily backups ensure there's always a backup from the last 24 hours. Even if the developer forgets, the automated system has a recent backup available.
Result: Restore from yesterday's automated backup, lose only 1 day of work instead of 5 days.
Scenario 2: Multiple Recovery Points
Problem: A bug was introduced 3 days ago, but you're not sure exactly when. You need to find the exact point when the bug appeared.
Solution with Automation: With daily automated backups, you have recovery points for each of the last 3 days. Restore each one and test to find when the bug was introduced.
Result: Pinpoint the exact day the bug was introduced, making it easier to identify the problematic change.
Scenario 3: Team Coordination
Problem: Multiple developers work on the same database. Manual backups create confusion about who backed up when.
Solution with Automation: Automated backups run on a consistent schedule, independent of who's working. Everyone knows backups happen at 2 AM daily.
Result: Clear, predictable backup schedule that the whole team can rely on.
Scenario 4: Compliance Requirements
Problem: Company policy requires daily backups, but manual backups are inconsistent.
Solution with Automation: Automated backups ensure compliance. Set up daily backups, and they run automatically without human intervention.
Result: Consistent compliance with backup policies, with audit trail showing regular automated backups.
Advanced: Multiple Backup Schedules
For critical databases, you might want multiple backup schedules:
๐ Tiered Backup Strategy
Hourly backups: During business hours (9 AM - 5 PM) for critical work
Daily backups: At 2 AM for full daily snapshots
Weekly backups: Sunday at midnight for long-term retention
Tagging: Use different tags for each tier (auto-hourly, auto-daily, auto-weekly)
This gives you:
- Frequent recovery points during active work
- Daily snapshots for standard recovery
- Weekly snapshots for long-term retention
- Flexibility to choose the right recovery point for any situation
Ready to Never Forget a Backup Again?
Set up automated backups with Quemsi and protect your data automatically. Focus on development while your backups run on schedule.
Get Started Free