Kahibaro
Discord Login Register

Backup strategies

Why Backup Strategy Matters

A backup strategy is more than “run rsync sometimes.” It is a plan that answers:

This chapter focuses on planning and design, not the tools themselves (those are covered in Using rsync, Creating tar archives, and Using snapshot systems).


Core Concepts in Backup Planning

RPO and RTO (How Much Can You Lose?)

Two key ideas shape your backup strategy:

Your RPO and RTO should drive all other choices in this chapter.


What to Back Up (Scope)

Not everything needs the same level of protection.

Typical categories:

Decisions to make:

Types of Backups

Full Backups

A full backup copies all selected data.

Use full backups:

Incremental Backups

An incremental backup stores only data changed since the last backup of any kind.

Example schedule:

This is a common approach when data changes daily and you want to save space.


Differential Backups

A differential backup stores data changed since the last full backup.

Example schedule:

This is a compromise between restore simplicity and storage usage.


Snapshots vs Traditional Backups

Snapshots are covered in depth in Using snapshot systems, but for strategy:

A good strategy often uses both:

The 3-2-1 Rule

A common guideline for reliable backups:

  1. 3 copies of your data
    • 1 primary (live data) + 2 backups
  2. 2 different media
    • For example: local disk + remote storage, or disk + tape, or disk + cloud.
  3. 1 off-site copy
    • Stored in another location (or in a different region/cloud).

Why it matters:

Backup Frequency and Retention

Choosing Backup Frequency

Tie this to RPO:

Consider:

Retention Policies

Retention is about how long you keep each backup.

Common patterns:

You can express a policy like:

You might implement this with naming conventions, directories, or your backup tool’s retention settings.

Trade-offs:

Storage Locations and Media Options

On-Site vs Off-Site

Balanced strategy:

Common Backup Targets

For each target, consider:

Designing a Practical Backup Plan

Example: Small Home Server

Requirements:

Possible strategy:

Example: Small Business Web + Database Server

Requirements:

Possible strategy:

Here you might combine:

Example: Developer Workstation

Requirements:

Possible strategy:

Automation and Scheduling

Even the best strategy fails if backups don’t actually run.

Key elements:

A basic approach:

  1. Write a backup script that:
    • Defines what to back up and where.
    • Logs its actions and exit status.
  2. Schedule it with cron or a systemd timer.
  3. Periodically verify logs and monitor disk usage on backup targets.

Security Considerations

Backups often contain everything an attacker wants.

Points to plan:

Remember: if backups are unencrypted and stolen, your security may be completely compromised.


Testing Restores

A backup that has never been tested is not reliable.

Elements of a restore test strategy:

You can integrate test restores into your schedule (e.g., monthly or quarterly).


Versioning and Change Tracking

Backups naturally produce versions over time.

Plan for:

For developers or teams:

Documenting Your Backup Strategy

Finally, an effective strategy is written down and kept up to date.

Your backup documentation should include:

Even on a single personal machine, having a short text file with these points helps you stay consistent and remember how to restore when you’re stressed.


By defining clear RPO/RTO targets, choosing appropriate backup types and schedules, following guidelines like 3-2-1, and regularly testing restores, you create a backup strategy that is practical, robust, and tailored to your Linux environments.

Views: 24

Comments

Please login to add a comment.

Don't have an account? Register now!