From 8da629387c7f8a433c9e7e9361ef6bf15c969be2 Mon Sep 17 00:00:00 2001 From: "M.Goldshteyn" Date: Thu, 12 Sep 2024 16:46:19 +0300 Subject: [PATCH] start --- migration.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration.sh b/migration.sh index 7ab7e19..bca9214 100644 --- a/migration.sh +++ b/migration.sh @@ -28,12 +28,14 @@ download_platform(){ # sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://localhost:5432/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "mv /home/platform5-server /home/platform5-server-${DATE} && mkdir -p /home/platform5-server && mkdir -p /home/platform5-server/bin/storage/1" -PLATFORM_DIRS="conf,lib,opencv,webapp,scripts,SERVER_config.txt,bin/server," + PLATFORM_DIRS="conf,lib,opencv,webapp,scripts,SERVER_config.txt" IFS=',' read -r -a array <<< "$PLATFORM_DIRS" for folder in "${array[@]}"; do yes | sshpass -p "$DESTINATION_PASSWORD" rsync -e "ssh -p $DESTINATION_PORT -o StrictHostKeyChecking=no" -avz --ignore-existing $SOURCE_PLATFORM_PATH/$folder $DESTINATION_USER@$DESTINATION_IP:$DESTINATION_PLATFORM_PATH/ done + yes | sshpass -p "$DESTINATION_PASSWORD" rsync -e "ssh -p $DESTINATION_PORT -o StrictHostKeyChecking=no" -avz --ignore-existing $SOURCE_PLATFORM_PATH/bin/server $DESTINATION_USER@$DESTINATION_IP:$DESTINATION_PLATFORM_PATH/bin/ + } download_platform