refactor(hosts): organize repository by server profiles (hosts/raspberrypi5, hosts/llm-node) and add host-aware installer

This commit is contained in:
Lars committed 2026-10-29 14:27:49 +01:00
1 parent c53fc0a939
commit c2740c9542
44 files changed
+528 -40

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Backup wrapper for Shinkan Production on llm-node (post-cutover)
set -Eeuo pipefail
DEST_ROOT="/mnt/nas_backup/shinkan/prod/db"
TS="$(date -u +%Y%m%dT%H%M%SZ)"
GEN_DIR="${DEST_ROOT}/generations/${TS}"
DUMP_FILE="${GEN_DIR}/shinkan-prod.sql"
install -d -m 0750 "${GEN_DIR}"
export DB_CONTAINER="shinkan-db-prod"
export DB_USER="shinkan"
export DB_NAME="shinkan"
export OUTPUT_PATH="${DUMP_FILE}"
/etc/backup-orchestrator/scripts/db-postgres-docker.sh
# Generate SHA256, Manifest (schemaVersion: 1), and Media Inventory (.media.jsonl)
/etc/backup-orchestrator/scripts/shinkan/shinkan-backup-manifest \
--dump "${DUMP_FILE}" \
--env prod \
--host "llm-node" \
--compose-dir "/home/llmadmin/docker/shinkan-prod" \
--media-dir "/srv/shinkan/prod/media" \
--db-container "shinkan-db-prod" \
--db-name "shinkan" \
--db-user "shinkan"
# Atomically update 'latest' symlink after complete backup set verification
ln -sfn "generations/${TS}" "${DEST_ROOT}/latest.tmp.$$"
mv -Tf "${DEST_ROOT}/latest.tmp.$$" "${DEST_ROOT}/latest"
echo "Published atomic Shinkan backup set on llm-node: ${GEN_DIR}"
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Standalone helper to generate manifest + media inventory for an existing dump on llm-node
set -Eeuo pipefail
DUMP_FILE="${1:-/mnt/nas_backup/shinkan/prod/db/latest/shinkan-prod.sql}"
exec /etc/backup-orchestrator/scripts/shinkan/shinkan-backup-manifest \
--dump "${DUMP_FILE}" \
--env prod \
--host "llm-node" \
--compose-dir "/home/llmadmin/docker/shinkan-prod" \
--media-dir "/srv/shinkan/prod/media" \
--db-container "shinkan-db-prod" \
--db-name "shinkan" \
--db-user "shinkan"