‹ BackHN Continuity

Thread

Backups Aren't Simple

359 points · 225 comments · afilipovski

  1. ebrahimh · · focus · HN ↗
    I’m setting up 3-2-1-ish backups for my infra of 3 hosts, and definitely leaning towards Restic + Backrest.

    All my hosts run the same CoreOS setup (<a href="https:&#x2F;&#x2F;github.com&#x2F;ebrahim37&#x2F;infra-template" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ebrahim37&#x2F;infra-template), where container volumes are placed in one central volumes&#x2F; folder and that is the only thing I have to backup.

    I plan to implement it like this:

      vps1:
      - restic container with custom sh entrypoint that will backup volumes&#x2F; to homelab every 24 hours
      homelab:
      - backrest container, to back up volumes&#x2F;, do prune&#x2F;check, replicate repo to offsite
      - rest-server container, will store backups from vps1, homelab, offsite
      offsite:
      - restic container, backs up volumes&#x2F; to homelab every 24 hours
      - rest-server container, store copy of backups from homelab
    
    Only caveat is backing up databases, will either have to do: stop container, backup volume&#x2F;database-data, start container; or use pg dump etc.

    The deduplication is nice, you can have a snapshot for each week of the past year without crazy storage cost

    1. codys · · focus · HN ↗
      If your system has a way to take consistent snapshots in the filesystem (btrfs, zfs) or volume manager (lvm2, perhaps with a bit of filesystem support to obtain fs consistency), that can be used to avoid database downtime, if desired.

      <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;current&#x2F;backup-file.html" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;current&#x2F;backup-file.html

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.