Backup Policies
A backup policy controls when automatic backups happen, how long they are kept, and who gets notified. You can set a default policy for the entire organization or configure individual environments with their own schedules.
How Policies Work
Every environment in OEC.sh can have a backup policy. The policy determines:
- Whether automatic backups are active (enabled/disabled toggle)
- When backups run (schedule)
- How long backups are kept (retention settings)
- Who gets notified when a backup succeeds or fails
If an environment does not have its own policy, it falls back to the organization's default policy.
Organization Default Policy
The default policy applies to every environment that has not been given a custom policy. This is the easiest way to manage backups when most of your environments need the same schedule.
To configure the default:
- Go to Settings > Backups tab
- Toggle Enable Backups on
- Choose a storage provider for backup files
- Set the schedule (see Schedule Options below)
- Configure retention settings
- Set notification preferences
- Click Save
Any environment without a custom policy will pick up these settings immediately.
Changing the organization default does not override environments that already have custom policies. Those environments keep their own settings.
Environment-Level Custom Policies
When a specific environment needs different settings -- maybe production needs hourly backups but staging only needs daily -- you create a custom policy for that environment.
To set a custom policy:
- Go to your Project > Environment > Backup Management tab
- Click Backup Policy
- Configure the settings for this environment
- Save the policy
The environment now ignores the organization default and uses its own policy.
Reverting to Organization Default
To stop using a custom policy and go back to the org default:
- Open the environment's Backup Policy
- Remove or reset the custom settings
- The environment will fall back to the organization default
Schedule Options
Presets
For most use cases, the built-in presets are sufficient:
| Preset | Schedule | Good For |
|---|---|---|
| Every 6 hours | Four times a day | High-traffic production environments |
| Daily | Once a day (typically 2 AM) | Most production environments |
| Weekly | Once a week | Staging, low-change environments |
Cron Expressions
For full control, use a cron expression. The format is:
minute hour day-of-month month day-of-weekExamples:
| Expression | Meaning |
|---|---|
0 2 * * * | Every day at 2:00 AM |
0 */6 * * * | Every 6 hours |
0 3 * * 0 | Every Sunday at 3:00 AM |
0 1 1 * * | First day of every month at 1:00 AM |
30 22 * * 1-5 | Weekdays at 10:30 PM |
All times are in UTC. If your team works in a different timezone, account for the offset when setting schedules.
GFS Retention Settings
OEC.sh uses a Grandfather-Father-Son (GFS) rotation scheme to keep backups efficiently. Instead of keeping every single backup forever, the system promotes certain backups to longer retention tiers.
| Tier | Default Retention | What Gets Kept |
|---|---|---|
| Daily | 7 days | Every backup from the past week |
| Weekly | 4 weeks | One backup per week for the past month |
| Monthly | 12 months | One backup per month for the past year |
| Yearly | 2 years | One backup per year for long-term archival |
How GFS Works in Practice
Say your policy runs daily backups:
- Each day, a new backup is created and marked as "daily"
- After 7 days, the oldest daily backups are deleted -- but the one from the start of each week is promoted to "weekly"
- After 4 weeks, old weekly backups are deleted -- but the one from the start of each month is promoted to "monthly"
- The same promotion happens from monthly to yearly
The result: you always have recent backups with high granularity (daily) and older backups with lower granularity (monthly, yearly). This balances recovery options against storage cost.
Customizing Retention
You can adjust each tier independently. Some common configurations:
Conservative (agency production)
- Daily: 14 days
- Weekly: 8 weeks
- Monthly: 24 months
- Yearly: 5 years
Minimal (development)
- Daily: 3 days
- Weekly: 2 weeks
- Monthly: 0 (disabled)
- Yearly: 0 (disabled)
Set any tier to 0 to skip that retention level entirely.
Notification Preferences
Backup policies can send notifications when backups complete or fail.
| Option | What It Does |
|---|---|
| Notify on success | Sends a notification after every successful backup |
| Notify on failure | Sends a notification when a backup fails |
For most organizations, enabling failure notifications is more practical than success notifications. You probably do not need to know that your 2 AM backup worked -- but you definitely need to know if it did not.
Notifications appear in the dashboard and are sent via email if email notifications are configured for your account.
Enabling and Disabling Policies
When to Disable
Disabling a backup policy makes sense for:
- Development environments where data resets frequently
- Test environments that get wiped and reseeded
- Staging environments that mirror production and do not hold unique data
When a policy is disabled:
- No automatic backups run
- The environment is excluded from the Backup Compliance metric on the dashboard
- You can still create manual backups at any time
When to Enable
Enable backups for any environment where losing data would be a problem. That includes all production environments and any staging environment with data that cannot be recreated easily.
To toggle a policy:
- Go to the environment's Backup Management tab
- Click Backup Policy
- Flip the Enabled toggle
- Save
Policy Inheritance Summary
Here is how the system decides which policy to use for a given environment:
Does the environment have a custom policy?
Yes -> Use the custom policy
No -> Use the organization default policy
(If no org default exists, no automatic backups run)The organization default acts as a safety net. Set it up once with reasonable settings, and every new environment automatically gets backup coverage without manual configuration.
Troubleshooting
Backups are not running on schedule
Check that the policy is enabled and the schedule is correct. Also verify that a storage provider is configured -- backups cannot run without somewhere to store them.
Environment is not using the org default
It probably has a custom policy overriding the default. Open the environment's Backup Policy to check.
Retention is not cleaning up old backups
GFS cleanup runs as part of the backup schedule. If you recently changed retention settings, it may take one full cycle for old backups to be cleaned up. Backups marked as "Permanent" retention are never automatically deleted.