feat: add place gate population scripts, map style assets, automated cron sync tasks, and expand dashboard and landing applications
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# ==============================================================================
|
||||
# SIRO Maps — Daily Database Backup Script
|
||||
# ==============================================================================
|
||||
set -euo pipefail
|
||||
|
||||
APP_DIR="${APP_DIR:-/home/hamzadoctor/app}"
|
||||
BACKUP_DIR="${APP_DIR}/backups/db"
|
||||
TIMESTAMP=$(date '+%Y%m%d_%H%M%S')
|
||||
BACKUP_FILE="${BACKUP_DIR}/mapdb_custom_tables_${TIMESTAMP}.sql.gz"
|
||||
RETENTION_DAYS=7
|
||||
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
echo "💾 [$(date '+%Y-%m-%d %H:%M:%S')] Starting SIRO Maps custom tables backup..."
|
||||
|
||||
# Dump custom tables: places_*, place_gates, billing, users, telemetry
|
||||
docker compose -f "${APP_DIR}/docker-compose.yml" exec -T db pg_dump -U mapuser -d mapdb \
|
||||
-t 'places_*' \
|
||||
-t 'place_gates' \
|
||||
-t 'users' \
|
||||
-t 'api_keys' \
|
||||
-t 'billing_*' \
|
||||
-t 'invoices' \
|
||||
-t 'subscriptions' \
|
||||
-t 'pricing_plans' \
|
||||
-t 'telemetry_*' \
|
||||
--no-owner --no-privileges | gzip > "$BACKUP_FILE"
|
||||
|
||||
echo "✅ Backup created successfully: $BACKUP_FILE ($(du -h "$BACKUP_FILE" | cut -f1))"
|
||||
|
||||
# Prune backups older than RETENTION_DAYS
|
||||
echo "🧹 Pruning backups older than ${RETENTION_DAYS} days..."
|
||||
find "$BACKUP_DIR" -type f -name "*.sql.gz" -mtime +"$RETENTION_DAYS" -delete
|
||||
|
||||
echo "🏁 [$(date '+%Y-%m-%d %H:%M:%S')] Backup process finished."
|
||||
Reference in New Issue
Block a user