changeset 529:579a61f2037d

add conditionals for ess db when backing up databases.
author Marc Davis <marc.davis@mcoecn.org>
date Thu, 02 May 2024 22:42:40 -0400
parents e483148f5283
children 7067a9e7e993 e4c73b1d3b28
files scripts/backup-container-docker.sh
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/backup-container-docker.sh	Tue Apr 23 14:47:12 2024 -0400
+++ b/scripts/backup-container-docker.sh	Thu May 02 22:42:40 2024 -0400
@@ -58,6 +58,17 @@
    echo "container name is $containerName"
 fi
 
+if [[ "$container" = "essdb" && -f ".env/ess-shared.properties" ]]; then
+   function prop {
+       grep "${1}" .env/ess-shared.properties|cut -d'=' -f2
+   }
+   entityId=$(prop 'entityId' | tr -d '"')
+   containerName="$entityId-ess-db"
+   backupFile=./backup/${entityId}-ess-db.$(date +%Y-%m-%d-%H-%M-%S).backup
+   echo "entityId is $entityId"
+   echo "container name is $containerName"
+fi
+
 if [ ! -z "$containerName" ]; then
    echo "Container is $container"
    if [ "$container" = "invdb" ]; then