diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:47:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:47:21 +0000 |
commit | 1ac4a2050c8076eb96e07e83721ebc9db864db94 (patch) | |
tree | da9b32212bf99154450a7668f61a75f65617a9fa /test/docker/docker-entrypoint-initdb.d/icinga/dump.sh | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.tar.xz icingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.zip |
Adding upstream version 0.3.3.upstream/0.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | test/docker/docker-entrypoint-initdb.d/icinga/dump.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/docker/docker-entrypoint-initdb.d/icinga/dump.sh b/test/docker/docker-entrypoint-initdb.d/icinga/dump.sh new file mode 100755 index 0000000..54f91a9 --- /dev/null +++ b/test/docker/docker-entrypoint-initdb.d/icinga/dump.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +CONFIG="$(docker-compose config)" +MYSQL_ROOT_PASSWORD="$(echo "$CONFIG" | grep MYSQL_ROOT_PASSWORD | cut -d: -f2 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + +set -x + +docker exec -i \ + "$(docker-compose ps -q db)" \ + mysqldump -p"${MYSQL_ROOT_PASSWORD}" --no-create-info icinga \ + icinga_instances icinga_programstatus icinga_objects \ + icinga_hosts icinga_hoststatus \ + icinga_services icinga_servicestatus \ + icinga_hostgroups icinga_hostgroup_members \ + > ido-data.sql + +docker exec -i \ + "$(docker-compose ps -q db)" \ + mysqldump -p"${MYSQL_ROOT_PASSWORD}" icinga \ + > full.sql |