Skip to content

Commit

Permalink
#139 renewed backup/restore influxdb containers
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Aug 22, 2018
1 parent c974fc9 commit 4b4953a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions services/influxdb-dc1/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# See https://www.influxdata.com/blog/backuprestore-of-influxdb-fromto-docker-containers/
# NB need to stop monitoring as influxdb will not stop because of cAdvisor lock!!!

SCRIPT_DIR=${0%/*}

pushd ${SCRIPT_DIR}
if [ ! -f influxdb.env ]
then
echo "Bestand influxdb.env niet gevonden."
exit 1
fi
source influxdb.env
popd

# On RUNNING container named influxdb
INFLUX_CMD="docker exec ${SE_CONTAINER_NAME} influx -host 127.0.0.1 -port 8086 -database ${INFLUXDB_DB} -username ${INFLUXDB_ADMIN_USER} -password ${INFLUXDB_ADMIN_PASSWORD} -execute "

echo "DROP DATABASE ${INFLUXDB_DB}..."
${INFLUX_CMD} "DROP DATABASE ${INFLUXDB_DB}"

0 comments on commit 4b4953a

Please sign in to comment.