Files
proxmox/scripts/backup/automated-backup.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

42 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Phase 2: Automated backup - configs + optional NPMplus.
# Usage: ./scripts/backup/automated-backup.sh [--dry-run] [--skip-npmplus]
# Cron example (daily 02:00): 0 2 * * * /path/to/automated-backup.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
DRY_RUN=false
SKIP_NPMPLUS=true
for arg in "$@"; do
[[ "$arg" == "--dry-run" ]] && DRY_RUN=true
[[ "$arg" == "--skip-npmplus" ]] && SKIP_NPMPLUS=true
[[ "$arg" == "--with-npmplus" ]] && SKIP_NPMPLUS=false
done
BACKUP_SCRIPT="${PROJECT_ROOT}/scripts/backup-proxmox-configs.sh"
NPMPLUS_SCRIPT="${PROJECT_ROOT}/scripts/verify/backup-npmplus.sh"
echo "[Phase 2] Automated backup $(date -Iseconds)"
echo " DRY_RUN=$DRY_RUN SKIP_NPMPLUS=$SKIP_NPMPLUS"
if $DRY_RUN; then
echo "[DRY-RUN] Would run: $BACKUP_SCRIPT"
[[ "$SKIP_NPMPLUS" == "false" ]] && echo "[DRY-RUN] Would run: $NPMPLUS_SCRIPT"
exit 0
fi
"$BACKUP_SCRIPT" || { echo "[ERROR] Config backup failed"; exit 1; }
if [[ "$SKIP_NPMPLUS" == "false" ]] && [[ -f "$NPMPLUS_SCRIPT" ]]; then
if [[ -n "${NPM_PASSWORD:-}" ]] || [[ -f "${PROJECT_ROOT}/.env" ]]; then
"$NPMPLUS_SCRIPT" || echo "[WARN] NPMplus backup failed (check NPM_PASSWORD)"
else
echo "[SKIP] NPMplus backup (NPM_PASSWORD not set)"
fi
fi
echo "[OK] Automated backup complete. See backups/configs/ and backups/npmplus/"