Files
ops/backups/scripts/ops-bundle.sh
Spencer c93dcb5daf Add initial infrastructure and backup scripts for Gitea and homelab deployment
- Create README.md with project layout and quick start instructions
- Implement backup scripts for Gitea, including database and repository exports
- Add systemd service and timer for automated Gitea backups
- Develop bootstrap scripts for homelab and VPS setup
- Document architecture and restore procedures
- Configure Caddy reverse proxy and Docker Compose for service management
- Establish secrets management guidelines
2026-03-04 14:42:46 -05:00

23 lines
549 B
Bash

#!/usr/bin/env bash
set -euo pipefail
OPS_REPO_PATH="${OPS_REPO_PATH:-/srv/ops}"
OUT_BASE="${OUT_BASE:-/srv/backups/ops}"
TS="$(date +%F_%H%M%S)"
OUT_DIR="$OUT_BASE/$TS"
LATEST_DIR="$OUT_BASE/latest"
if [[ ! -d "$OPS_REPO_PATH/.git" ]]; then
echo "Missing git repo at $OPS_REPO_PATH"
exit 1
fi
mkdir -p "$OUT_DIR"
git -C "$OPS_REPO_PATH" bundle create "$OUT_DIR/ops.bundle" --all
mkdir -p "$LATEST_DIR"
cp "$OUT_DIR/ops.bundle" "$LATEST_DIR/ops.bundle"
echo "Wrote bundle: $OUT_DIR/ops.bundle"
echo "Updated latest: $LATEST_DIR/ops.bundle"