diff scripts/backup-container-docker.sh @ 521:8ddeb5a36678 hotfix/2.16.1

add itcm backup conditionals
author Marc Davis <marc.davis@mcoecn.org>
date Tue, 30 Jan 2024 10:54:23 -0500
parents 886a7dc796b8
children 579a61f2037d
line wrap: on
line diff
--- a/scripts/backup-container-docker.sh	Tue Jan 30 10:53:31 2024 -0500
+++ b/scripts/backup-container-docker.sh	Tue Jan 30 10:54:23 2024 -0500
@@ -47,6 +47,17 @@
    echo "container name is $containerName"
 fi
 
+if [[ "$container" = "itcmdb" && -f ".env/itcm-shared.properties" ]]; then
+   function prop {
+       grep "${1}" .env/itcm-shared.properties|cut -d'=' -f2
+   }
+   entityId=$(prop 'entityId' | tr -d '"')
+   containerName="$entityId-itcm-db"
+   backupFile=./backup/${entityId}-itcm-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