Add /etc and /home bind mounts to Backrest and explain Paths selection

This commit is contained in:
Djeex
2026-09-09 14:03:23 +02:00
parent 7c89513b5b
commit 2d1865f0e0
2 changed files with 12 additions and 4 deletions
@@ -76,6 +76,8 @@ services:
# Whatever you want Backrest to be able to back up has to be
# mounted here too: this stack only sees what it's given.
- /srv/docker:/userdata/docker:ro
- /etc:/userdata/etc:ro
- /home:/userdata/home:ro
environment:
- BACKREST_DATA=/data
- BACKREST_CONFIG=/config/config.json
@@ -84,7 +86,9 @@ services:
```
::note
The `/srv/docker:/userdata/docker:ro` line is what lets Backrest see the rest of your stacks to back them up, mounted read-only since a backup tool has no business writing to the things it's backing up. Add one line per host folder you want covered, `/media:/userdata/media:ro` for your media library, and so on. Got a USB key or external drive plugged in? Mount it too, that's exactly where your first repository is going.
These three lines cover what's actually worth an off-site backup on a homelab server, per [folders and partitions](/general/linux/filesystem): `/srv/docker` holds every stack's config and data (databases, uploaded files, Vaultwarden's vault, Pocket ID's users, and so on), `/etc` holds your system configuration (the SSH hardening from the [installation guide](/serveex/core/installation#close-the-door-behind-you), your SWAG `.subdomain.conf` files, systemd units), and `/home` holds your own scripts and notes. All three mounted read-only, a backup tool has no business writing to what it's backing up.
What's usually **not** worth it: a big media library or a torrent download folder sitting on a separate data disk. It's often huge, replaceable, and rarely worth paying for cloud storage or SSH bandwidth to protect. Mount it too if you disagree, `/media:/userdata/media:ro` for instance, just think about the size first.
::
::tip{icon=""}
@@ -229,7 +233,7 @@ Back in Backrest, go to **Add Plan**. This form covers what to back up and when,
- **Plan Name**: same rule as the repo name, pick something clear, you can't change it later.
- **Repository**: the one you just created above.
- **Paths**: pick from what you mounted earlier, `/userdata/docker` for your stacks, for instance. You can add several.
- **Paths**: click **Add** to add a row, then type in the container-side path for whatever you mounted above, there's no folder browser, just a plain text field. `/userdata/docker` for your stacks, `/userdata/etc` for your system config, `/userdata/home` for your own files. Click **Add** again for each additional folder, the small `-` button removes a row you don't need.
- **Excludes** and **Excludes (Case Insensitive)**: patterns to skip within those paths, handy for cache folders or anything genuinely disposable that would otherwise bloat every snapshot for no reason.
- **Schedule Type**: same three choices as the repository's own schedules above, `Disabled`, an `Interval`, or a `Cron Expression`. A nightly cron like `0 3 * * *` (every day at 3 AM) is a reasonable default for a homelab.
- **Retention Policy**: how many snapshots to keep, and for how long. **By Time Period** lets you say "keep 7 daily, 4 weekly, 6 monthly" independently, which gives you plenty of restore points spread over time without the repository growing forever, since restic deduplicates unchanged data between snapshots anyway. **By Count** instead just keeps the last N snapshots regardless of age. **Latest (Count)** on top of either mode guarantees a minimum number of recent snapshots always survive, whatever the rest of the policy says.