-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#139 renewed backup/restore influxdb containers
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |