changeset 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 3ae0a0fc97e2
children 11593e9300f2
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 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