update deploy rsync

This commit is contained in:
2020-04-12 12:16:17 +02:00
parent c97fa79cf9
commit bbac68f526

View File

@@ -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"