kevin.batailleandClaude Sonnet 4.6 74390b78af feat: extract deployment config into configs/ for multi-server reuse
Both borg-backup.sh and restore.sh now source a config file instead of
hardcoding paths and container names. Default is backup.conf next to the
script; override with BACKUP_CONF=/path/to/other.conf.

- configs/srv.conf     — current server (unchanged behaviour)
- configs/nexusvoice.conf — nexusvoice server (/home/acid/nexusvoice,
                            separate Scaleway path par-backup-1/nexusvoice)
- DB steps in borg-backup.sh are now guarded on [[ -n "$DB_CONTAINER" ]]
  so a config with DB_CONTAINER="" skips the dump entirely
- RUNBOOK.md §2 documents single and multi-deployment patterns

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3rQSEidP6Y61kaCtxjVV1
2026-08-30 23:45:10 +01:00

backup-agent

Backup and disaster-recovery tooling for a Linux server: Borg backing up /home/srv/files/content — including a MariaDB database running in Docker — with an offsite mirror on Scaleway S3 via rclone.

MariaDB is never stopped during backup: dump_db.sh takes a transactionally-consistent logical dump (mysqldump --single-transaction) while the container keeps running, and the container's raw data directory is excluded from the archive entirely (a .nobackup marker file), so only the logical dump ever gets backed up. Zero DB downtime.

Components

File Purpose
borg-backup.sh Daily backup orchestrator (run from cron): dump → archive → prune → compact → integrity check → offsite sync.
dump_db.sh Per-database mysqldump/mariadb-dump, atomic staging/swap. Invoked by borg-backup.sh.
restore.sh Recovery CLI: full (disaster recovery), db <name> (single database), file <path> (single file/dir), --list-archives. Every mode supports --dry-run.

Quickstart

# One-time setup, deployment, cron scheduling, day-2 ops, and step-by-step
# recovery for every scenario are all in:
less RUNBOOK.md

Day to day:

./restore.sh --list-archives          # what backups exist
./restore.sh full --dry-run           # preview a disaster recovery
./restore.sh db <name> --dry-run      # preview a single-database restore
./restore.sh file <path> --dest DIR   # pull one file out of an archive

Encryption

The Borg repo at /home/srv/files/backups/borg-2025 is unencrypted by deliberate choice on this deployment — borg-backup.sh will keep printing a warning about it on every run, which is expected. See RUNBOOK.md if you want to switch to an encrypted repo.

Requirements

borg, docker, rclone, flock, a mysql/mariadb client — see REQUIRED_CMDS in borg-backup.sh. Targets Linux; flock(1) doesn't exist on macOS, so these scripts won't run as-is on a Mac.

License

None specified — internal tooling.

S
Description
Simple backup agent using Bash scripts with Bord and S3
Readme
189 KiB
Languages
Shell 100%