---
name: treehouse-backups
description: Treehouse backup management — borgmatic/borg backups to Hetzner Storage Box. Use for checking backup status, triggering manual backups, restoring data, or modifying backup config.
allowed-tools: Bash(ssh:*), Bash(sudo:*), Read, Write, Edit
---

# Treehouse Backups (borgmatic/borg)

SSH: `ssh treehouse-host '<command>'`

Automated daily backups to a Hetzner Storage Box via borgmatic. Config is managed declaratively in `/etc/nixos/borgmatic.nix`.

## Config

- **Remote repo:** `ssh://u526067@u526067.your-storagebox.de:23/./treehouse-backup`
- **What is backed up:** `/home`
- **Encryption:** repokey-blake2
- **Retention:** 7 daily, 4 weekly, 6 monthly
- **Schedule:** systemd timer (`borgmatic.timer`), runs daily
- **SSH key:** `/root/.ssh/id_ed25519` (restricted to `treehouse-backup` path on storage box)

The admin user has passwordless sudo for borgmatic.

## Common Commands

```bash
# Check timer status
systemctl status borgmatic.timer

# List archives
sudo borgmatic list

# Create a backup now
sudo borgmatic create --verbosity 1

# Show backup info
sudo borgmatic info

# Check backup integrity
sudo borgmatic check

# Extract/restore
sudo borgmatic extract --archive latest --destination /tmp/restore

# CLI shortcut
treehouse backups status
```

## Modifying Backup Config

Edit `/etc/nixos/borgmatic.nix` and run `sudo nixos-rebuild switch`. Never configure borgmatic imperatively.
