From bbac68f526e806573410490eb20e8617a42688a7 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sun, 12 Apr 2020 12:16:17 +0200 Subject: [PATCH] update deploy rsync --- deploy.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy.sh b/deploy.sh index 5fb1636..ad98a52 100644 --- a/deploy.sh +++ b/deploy.sh @@ -11,6 +11,8 @@ do user="${line##*=}" elif [ "DB_PASSWORD" == "${line%=*}" ]; then pass="${line##*=}" + elif [ "RSYNC_SAV" == "${line%=*}" ]; then + rsync="${line##*=}" fi done < "$input" @@ -29,6 +31,11 @@ fi mysqldump --user="$user" --password="$pass" -B "$database" > storage/logs/database/save-"$database"-"$year""$month""$day"-"$hour""$minutes".sql +if [ $rsync ]; then + echo 'save by Rsync' + rsync -avz --progress storage/logs/database/save-"$database"-"$year""$month""$day"-"$hour""$minutes".sql ssh $rsync +fi + if [ "production" == "$env" ]; then echo "deploy in production"