Files
smom-dbis-138/scripts/vm-deployment/backup-vm.sh
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

50 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Backup VM data script
# This script backs up Besu data from a VM
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Configuration
VM_IP="${1:-}"
BACKUP_DIR="${BACKUP_DIR:-/backup/vm}"
DATE=$(date +%Y%m%d-%H%M%S)
if [ -z "$VM_IP" ]; then
log_error "Error: VM IP not provided"
echo "Usage: $0 <vm-ip>"
exit 1
fi
log_success "Backing up VM data: $VM_IP"
# Create backup directory
mkdir -p "$BACKUP_DIR"
# Stop Besu container
log_warn "Stopping Besu container..."
ssh besuadmin@$VM_IP "docker compose -f /opt/besu/docker-compose.yml down"
# Backup data
log_warn "Backing up data..."
ssh besuadmin@$VM_IP "tar czf - /opt/besu/data /opt/besu/config" > "$BACKUP_DIR/vm-$VM_IP-$DATE.tar.gz"
if [ $? -eq 0 ]; then
log_success "✓ Backup created: vm-$VM_IP-$DATE.tar.gz"
else
log_error "✗ Backup failed"
exit 1
fi
# Restart Besu container
log_warn "Restarting Besu container..."
ssh besuadmin@$VM_IP "docker compose -f /opt/besu/docker-compose.yml up -d"
log_success "Backup completed!"