Mercurial > public > ssdt-docker
comparison scripts/backup-container-docker.sh @ 395:b3909bd1a2b6
INV-198 fix output of backup-container-docker.sh and create restore-inventory.sh script
author | Matt Calmes <calmes@ssdt-ohio.org> |
---|---|
date | Wed, 27 Oct 2021 22:36:34 -0400 |
parents | 56498d910235 |
children | 886a7dc796b8 |
comparison
equal
deleted
inserted
replaced
394:326978b4b0be | 395:b3909bd1a2b6 |
---|---|
29 echo "no IRN set,using 000000" | 29 echo "no IRN set,using 000000" |
30 IRN=000000 | 30 IRN=000000 |
31 fi | 31 fi |
32 ##Take out the extra space from IRN returned from db. | 32 ##Take out the extra space from IRN returned from db. |
33 IRN=`echo $IRN | sed -e 's/^[[:space:]]*//'` | 33 IRN=`echo $IRN | sed -e 's/^[[:space:]]*//'` |
34 backupFile=./backup/${IRN}${entityId}-${container}.$(date +%Y-%m-%d-%H-%M-%S).backup | 34 backupFile=./backup/${IRN}${entityId}-inventory-db.$(date +%Y-%m-%d-%H-%M-%S).backup |
35 echo "entityId is $entityId" | 35 echo "entityId is $entityId" |
36 echo "container name is $containerName" | 36 echo "container name is $containerName" |
37 fi | 37 fi |
38 | 38 |
39 if [[ "$container" = "workflowsdb" && -f ".env/ssdt-workflows-shared.properties" ]]; then | 39 if [[ "$container" = "workflowsdb" && -f ".env/ssdt-workflows-shared.properties" ]]; then |
40 function prop { | 40 function prop { |
41 grep "${1}" .env/ssdt-workflows-shared.properties|cut -d'=' -f2 | 41 grep "${1}" .env/ssdt-workflows-shared.properties|cut -d'=' -f2 |
42 } | 42 } |
43 entityId=$(prop 'entityId' | tr -d '"') | 43 entityId=$(prop 'entityId' | tr -d '"') |
44 containerName="$entityId-workflows-db" | 44 containerName="$entityId-workflows-db" |
45 backupFile=./backup/${entityId}-${container}.$(date +%Y-%m-%d-%H-%M-%S).backup | 45 backupFile=./backup/${entityId}-workflows-db.$(date +%Y-%m-%d-%H-%M-%S).backup |
46 echo "entityId is $entityId" | 46 echo "entityId is $entityId" |
47 echo "container name is $containerName" | 47 echo "container name is $containerName" |
48 fi | 48 fi |
49 | 49 |
50 if [ ! -z "$containerName" ]; then | 50 if [ ! -z "$containerName" ]; then |
65 # exit 1 | 65 # exit 1 |
66 #fi | 66 #fi |
67 | 67 |
68 gzip ${backupFile} | 68 gzip ${backupFile} |
69 | 69 |
70 echo "completed backup of $container to ${backupFile}" | 70 echo "completed backup of $container to ${backupFile}.gz" |
71 fi | 71 fi |