changeset 341:9735d4fef9c5 production v2.7.0

flow: Merged <release> '2.7.0' to <master> ('production').
author aldrich@ssdt-ohio.org
date Mon, 04 May 2020 19:13:14 +0100
parents 44ccc79ca501 (current diff) 6adffe4f0b5d (diff)
children 27ae05ebfc1a
files
diffstat 2 files changed, 63 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/prod/setup.sh	Tue Nov 12 16:16:00 2019 +0000
+++ b/prod/setup.sh	Mon May 04 19:13:14 2020 +0100
@@ -7,7 +7,7 @@
 #
 # Will create a docker-compose.yml and .env file with default settings.
 #
-# 
+# Put back in default on 5/4/2020
 source "$(dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh"
 
 md5calc() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/remote-backup-existing.sh	Mon May 04 19:13:14 2020 +0100
@@ -0,0 +1,62 @@
+#!/bin/bash
+# This is similar to the remote backup script except it uses an existing database backup
+# MCOECN personnel used the basic script and modified it 
+# The current directory is expected to contain a project configured
+# as with SSDT conventions for an application database.
+#
+# The file will also be placed on the specified remote target
+# The format of the output is a compressed pg_dump (sql) format.
+#  Still needs tweaking
+#  
+# testing changes additional
+# This will send both usasdb and uspsdb,
+# along with the top level contents of the project directory
+#Environment variables can be used for REMOTE_BACKUP_TARGET and REMOTE_USERNAME
+remoteTarget=${1:-$REMOTE_BACKUP_TARGET}
+userName=${2:-$REMOTE_USERNAME}
+projectDir=${3:-$PWD}
+
+cd $projectDir
+
+source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"
+
+set -o pipefail
+
+project=$(composeGetProject)
+
+#If the project is empty, we want to stop the process because this is being run                                                                                                                      from the wrong directory
+
+if [ "$project" == "" ]; then
+
+   echo "no project available"
+
+   exit 1
+
+fi
+
+echo "project is $project"
+echo "Remote target is $remoteTarget"
+echo "Username is $userName"
+
+
+backupFile1=$(ls ./backup/*usasdb*.backup.gz | tail -n 1)
+backupFile2=$(ls ./backup/*uspsdb*.backup.gz | tail -n 1)
+
+
+#Create remote directory before scp
+host=`echo $userName@$remoteTarget | sed -e 's/:.*//'`
+
+target=`echo $remoteTarget | sed -e 's/.*://'`
+
+
+ssh $host mkdir -p $target/$project
+
+#SCP files
+#
+scp ${backupFile1}  ${backupFile2}  $userName@$remoteTarget/$project
+
+echo " "
+
+echo "completed sending ${backupFile1} and ${backupFile2} to ${remoteTarget}/${project} as user $userName"
+
+