remove emojis from console
This commit is contained in:
@@ -7,7 +7,7 @@ set -e
|
||||
|
||||
# Check if backup file is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "❌ Usage: $0 <backup_file.tar.gz>"
|
||||
echo " Usage: $0 <backup_file.tar.gz>"
|
||||
echo "Available backups:"
|
||||
ls -la ./backups/market_data_backup_*.tar.gz 2>/dev/null || echo "No backups found"
|
||||
exit 1
|
||||
@@ -22,12 +22,12 @@ if [ -f .env ]; then
|
||||
source .env
|
||||
fi
|
||||
|
||||
echo "🔄 Starting restore process..."
|
||||
echo " Starting restore process..."
|
||||
echo "📁 Backup file: $BACKUP_FILE"
|
||||
|
||||
# Check if backup file exists
|
||||
if [ ! -f "$BACKUP_FILE" ]; then
|
||||
echo "❌ Backup file not found: $BACKUP_FILE"
|
||||
echo " Backup file not found: $BACKUP_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -44,7 +44,7 @@ REDIS_BACKUP=$(find "$RESTORE_DIR" -name "redis_backup_*.rdb" | head -1)
|
||||
BACKUP_INFO=$(find "$RESTORE_DIR" -name "backup_*.info" | head -1)
|
||||
|
||||
if [ -z "$TIMESCALE_BACKUP" ] || [ -z "$REDIS_BACKUP" ]; then
|
||||
echo "❌ Invalid backup file structure"
|
||||
echo " Invalid backup file structure"
|
||||
rm -rf "$RESTORE_DIR"
|
||||
exit 1
|
||||
fi
|
||||
@@ -57,10 +57,10 @@ if [ -f "$BACKUP_INFO" ]; then
|
||||
fi
|
||||
|
||||
# Confirm restore
|
||||
read -p "⚠️ This will replace all existing data. Continue? (y/N): " -n 1 -r
|
||||
read -p " This will replace all existing data. Continue? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "❌ Restore cancelled"
|
||||
echo " Restore cancelled"
|
||||
rm -rf "$RESTORE_DIR"
|
||||
exit 1
|
||||
fi
|
||||
@@ -85,7 +85,7 @@ sleep 30
|
||||
|
||||
# Check if TimescaleDB is ready
|
||||
if ! docker exec market_data_timescaledb pg_isready -U market_user -d market_data; then
|
||||
echo "❌ TimescaleDB is not ready"
|
||||
echo " TimescaleDB is not ready"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -105,9 +105,9 @@ docker exec market_data_timescaledb pg_restore \
|
||||
/tmp/restore.dump
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ TimescaleDB restore completed"
|
||||
echo " TimescaleDB restore completed"
|
||||
else
|
||||
echo "❌ TimescaleDB restore failed"
|
||||
echo " TimescaleDB restore failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -136,7 +136,7 @@ echo "🔍 Verifying restore..."
|
||||
|
||||
# Check TimescaleDB
|
||||
if docker exec market_data_timescaledb pg_isready -U market_user -d market_data; then
|
||||
echo "✅ TimescaleDB is ready"
|
||||
echo " TimescaleDB is ready"
|
||||
|
||||
# Show table counts
|
||||
echo "📊 Database table counts:"
|
||||
@@ -150,19 +150,19 @@ if docker exec market_data_timescaledb pg_isready -U market_user -d market_data;
|
||||
ORDER BY tablename;
|
||||
"
|
||||
else
|
||||
echo "❌ TimescaleDB verification failed"
|
||||
echo " TimescaleDB verification failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check Redis
|
||||
if docker exec market_data_redis redis-cli -a "$REDIS_PASSWORD" ping | grep -q PONG; then
|
||||
echo "✅ Redis is ready"
|
||||
echo " Redis is ready"
|
||||
|
||||
# Show Redis info
|
||||
echo "📦 Redis database info:"
|
||||
docker exec market_data_redis redis-cli -a "$REDIS_PASSWORD" INFO keyspace
|
||||
else
|
||||
echo "❌ Redis verification failed"
|
||||
echo " Redis verification failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -178,7 +178,7 @@ echo " Source: $BACKUP_FILE"
|
||||
echo " Timestamp: $TIMESTAMP"
|
||||
echo " Safety backup: ./backups/pre_restore_$TIMESTAMP/"
|
||||
echo ""
|
||||
echo "⚠️ If you encounter any issues, you can restore the safety backup:"
|
||||
echo " If you encounter any issues, you can restore the safety backup:"
|
||||
echo " docker-compose -f timescaledb-compose.yml down"
|
||||
echo " docker volume rm market_data_timescale_data market_data_redis_data"
|
||||
echo " docker volume create market_data_timescale_data"
|
||||
|
||||
Reference in New Issue
Block a user