diff scripts/backup-container-docker.sh @ 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 8ddeb5a36678
children fb25711eead7
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