Last active
April 18, 2017 13:47
-
-
Save twstokes/f7062412fef196a9a1b0917a7c6e9882 to your computer and use it in GitHub Desktop.
InfluxDB Docker backups
This file contains hidden or 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
#!/bin/bash | |
mkdir ./backups | |
dbs=( "_internal" "telegraf" "health" "nodemcu" "sensors" ) | |
for db in "${dbs[@]}" | |
do | |
docker run --rm -v $PWD/backups:/backups influxdb influxd backup -database $db -host influx-hostname:8088 /backups/$db | |
done | |
date=`date "+%Y-%m-%d-%H:%M:%S"` | |
tar -cvf ./"influx_backup-${date}.tar" ./backups | |
rm -rf ./backups |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment