mirror of
https://github.com/Mak5er/Downloader-Bot
synced 2026-11-26 17:18:04 +08:00
Add postgres, db-init, and backup services to docker-compose. Migrate database from Neon DB to self-hosted PostgreSQL 17. - postgres:17-alpine with healthcheck and persistent volume - db-init: auto-restore from local dump or Backblaze B2 on first start - backup: scheduled pg_dump with B2 upload (daily at 3am) - Host-side scripts: backup.sh, restore.sh, cron-backup.sh - Fixed dynamic table ownership in restore (no hardcoded table names) - Fixed pg_restore to use docker cp instead of stdin pipe
15 lines
308 B
Bash
Executable File
15 lines
308 B
Bash
Executable File
#!/bin/bash
|
|
# Wrapper script for cron - sources env and runs backup
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
# Load backup environment if exists
|
|
if [ -f "${SCRIPT_DIR}/.env.backup" ]; then
|
|
set -a
|
|
source "${SCRIPT_DIR}/.env.backup"
|
|
set +a
|
|
fi
|
|
|
|
exec "${SCRIPT_DIR}/backup.sh"
|