Overview

Two-tier backup on the 4TB SSD:

๐Ÿ”’ Restic

Deduplicating, encrypted backups of /home/wm, configs, and dotfiles. Runs daily at 4:00 AM.

Data tier

๐Ÿ”„ Timeshift

System snapshots using rsync. Weekly + monthly + boot. Roll back entire system state.

System tier

Restic (Data Backup)

Setup

# Initialize repository
sudo restic init --repo /media/wm/2TB-Data/restic-repo
# Password stored in ~/.config/restic/password (chmod 600)

# Backup script: /home/wm/bin/backup-system.sh
#!/bin/bash
export RESTIC_PASSWORD_FILE=/home/wm/.config/restic/password
restic --repo /media/wm/2TB-Data/restic-repo backup \
    /home/wm /etc/fstab /etc/timeshift /etc/docker \
    --exclude-file=/home/wm/.restic-exclude

Exclude file (.restic-exclude)

# Models (already on 4TB drive)
**/.ollama/models/

# Docker data (rebuildable)
**/docker/
**/docker-volumes/

# Caches
**/.cache/
**/.npm/
**/.local/share/Trash/

# Downloads
**/Downloads/

# Large media (back up separately if needed)
**/media/
**/Videos/

# Runtime data
**/.openclaw/
**/sessions/
**/.tmp/
๐Ÿ’ก First backup stats 63.4 GB processed โ†’ 30.6 GB stored (deduplication). Snapshot ID: 8f592c32.

Commands

# List snapshots
restic --repo /media/wm/2TB-Data/restic-repo snapshots

# Restore latest to /tmp/restore
restic --repo /media/wm/2TB-Data/restic-repo restore latest --target /tmp/restore

# Mount a snapshot (browse without extracting)
restic --repo /media/wm/2TB-Data/restic-repo mount /mnt/restic-mount

# Keep only last 7 daily, 4 weekly, 12 monthly
restic --repo /media/wm/2TB-Data/restic-repo forget \
    --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune

Timeshift (System Snapshots)

Config (/etc/timeshift/timeshift.json)

{
  "backup_device_uuid": "0808242B082419E8",
  "snapshot_levels": {
    "hourly": 0,
    "daily": 0,
    "weekly": 4,
    "monthly": 3,
    "boot": 3
  },
  "exclude": [
    "/home/wm/.ollama/models/**",
    "/home/wm/.cache/**",
    "/var/log/**",
    "/var/cache/**",
    "/var/lib/docker/**",
    "/media/**",
    "/mnt/**",
    "/swap.img"
  ],
  "snapshot_type": "rsync"
}

Timeshift + NTFS note

Timeshift wants exclusive mount control. If the target partition is already mounted (e.g., via fstab), Timeshift will unmount it during snapshot creation. After the snapshot, remount manually:

sudo mount /media/wm/2TB-Data

Better solution: use noauto in fstab + a systemd service to mount at boot after local-fs.target.

โš ๏ธ First snapshot on NTFS is slow The initial rsync to NTFS took ~20 minutes. Subsequent snapshots are incremental and much faster. Be patient.

Cron Schedule

Time Job Script
3:00 AM SillyTavern backup backup-sam.sh
4:00 AM System backup (Restic) backup-system.sh
Sundays Timeshift snapshot timeshift --create
Monthly Timeshift monthly snapshot timeshift --create
Boot Timeshift boot snapshot Automatic

Restore Procedures

Restic restore (single file or directory)

# Find the snapshot
restic snapshots
# Restore a specific path
restic restore  --target /tmp/restore --include /home/wm/.bashrc
# Copy back to original location
cp /tmp/restore/home/wm/.bashrc /home/wm/.bashrc

Timeshift restore (full system rollback)

  1. Boot Ubuntu Live USB
  2. Install timeshift: sudo apt install timeshift
  3. Select snapshot device: /dev/nvme0n1p3
  4. Choose snapshot โ†’ Restore
  5. Reboot
๐Ÿ”ด Windows backup Macrium Reflect handles the Windows side. No Linux version exists. Keep Windows images on the OS-BK partition. Timeshift and Restic do NOT back up Windows.