comparison scripts/backup-container.sh @ 314:d78b45c28205

backup script adding IRN to name
author aldrich@ssdt-ohio.org
date Mon, 28 Oct 2019 19:43:53 +0100
parents 4cc087cde1d0
children 58c49a386a11
comparison
equal deleted inserted replaced
313:06e92ad77e7f 314:d78b45c28205
17 17
18 project=$(composeGetProject) 18 project=$(composeGetProject)
19 19
20 set -o pipefail 20 set -o pipefail
21 mkdir -p ./backup 21 mkdir -p ./backup
22 backupFile=./backup/${project}-${container}.$(date +%Y-%m-%d-%H-%M-%S).backup 22 ##
23 ##THis one puts a space before the IRN
24 IRN=$(docker-compose exec -T $container psql --username=postgres --dbname=$container -t -c 'select irn from organization')
25 ##Trim function in postgres didn't work - so take out the extra space this way.
26 IRN=`echo $IRN | sed -e 's/^[[:space:]]*//'`
23 27
28 backupFile=./backup/${IRN}${project}-${container}.$(date +%Y-%m-%d-%H-%M-%S).backup
29 #echo "IRNS${IRNS}"
30 echo "IRN${IRN}"
31
32 echo "backup file ${backupFile}"
24 echo "preparing to backup ${container} on current project at ${projectDir}:" 33 echo "preparing to backup ${container} on current project at ${projectDir}:"
25 echo " " 34 echo " "
26 35
27 36
28 37