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"