From f7c94a19b96afaaa0707c3c21ae8efe791519e12 Mon Sep 17 00:00:00 2001 From: "M.Goldshteyn" Date: Fri, 6 Sep 2024 09:54:48 +0300 Subject: [PATCH] backup name --- create_db.sh.template | 2 +- migration.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/create_db.sh.template b/create_db.sh.template index 0184268..b16b835 100644 --- a/create_db.sh.template +++ b/create_db.sh.template @@ -11,4 +11,4 @@ su - postgres -c "PGPASSWORD=\"DESTINATION_POSTGRES_PASSWORD\" psql -U postgres set "PGPASSWORD=\"DESTINATION_POSTGRES_PASSWORD\"" -su - postgres -c "pg_restore -j 2 -d DESTINATION_DB_NAME DB_BACKUP" \ No newline at end of file +su - postgres -c "pg_restore -j 2 -d DESTINATION_DB_NAME /var/backups/DB_BACKUP" \ No newline at end of file diff --git a/migration.sh b/migration.sh index dfb7ba1..4fdc901 100644 --- a/migration.sh +++ b/migration.sh @@ -36,7 +36,7 @@ send_backup() { if [[ "$EVENT_STORE" == 0 ]] || [[ "$EVENT_STORE" == 1 ]]; then echo "send dump to the destination" echo Sending db backup to destination server - cd /var/backups/ && yes | sshpass -p "$DESTINATION_DATABASE_PASSWORD" scp -P $DESTINATION_DATABASE_PORT -o StrictHostKeyChecking=no $DB_BACKUP $DESTINATION_DATABASE_USER@$DESTINATION_DATABASE_IP:~/ + cd /var/backups/ && yes | sshpass -p "$DESTINATION_DATABASE_PASSWORD" scp -P $DESTINATION_DATABASE_PORT -o StrictHostKeyChecking=no $DB_BACKUP $DESTINATION_DATABASE_USER@$DESTINATION_DATABASE_IP:/var/backups cd - else echo "no backup, nothing to send" && exit fi