Product Guide
Backup Policies

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:

  1. Go to Settings > Backups tab
  2. Toggle Enable Backups on
  3. Choose a storage provider for backup files
  4. Set the schedule (see Schedule Options below)
  5. Configure retention settings
  6. Set notification preferences
  7. 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:

  1. Go to your Project > Environment > Backup Management tab
  2. Click Backup Policy
  3. Configure the settings for this environment
  4. 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:

  1. Open the environment's Backup Policy
  2. Remove or reset the custom settings
  3. The environment will fall back to the organization default

Schedule Options

Presets

For most use cases, the built-in presets are sufficient:

PresetScheduleGood For
Every 6 hoursFour times a dayHigh-traffic production environments
DailyOnce a day (typically 2 AM)Most production environments
WeeklyOnce a weekStaging, low-change environments

Cron Expressions

For full control, use a cron expression. The format is:

minute  hour  day-of-month  month  day-of-week

Examples:

ExpressionMeaning
0 2 * * *Every day at 2:00 AM
0 */6 * * *Every 6 hours
0 3 * * 0Every Sunday at 3:00 AM
0 1 1 * *First day of every month at 1:00 AM
30 22 * * 1-5Weekdays 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.

TierDefault RetentionWhat Gets Kept
Daily7 daysEvery backup from the past week
Weekly4 weeksOne backup per week for the past month
Monthly12 monthsOne backup per month for the past year
Yearly2 yearsOne backup per year for long-term archival

How GFS Works in Practice

Say your policy runs daily backups:

  1. Each day, a new backup is created and marked as "daily"
  2. After 7 days, the oldest daily backups are deleted -- but the one from the start of each week is promoted to "weekly"
  3. After 4 weeks, old weekly backups are deleted -- but the one from the start of each month is promoted to "monthly"
  4. 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.

OptionWhat It Does
Notify on successSends a notification after every successful backup
Notify on failureSends 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:

  1. Go to the environment's Backup Management tab
  2. Click Backup Policy
  3. Flip the Enabled toggle
  4. 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.