Created
July 24, 2017 20:57
-
-
Save sxd/c89b88c5804c3ecfff111066c3d469a3 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
HOST=$1 | |
DEST=$2 | |
DATE=`date +%Y-%m-%d` | |
influxd backup -host $HOST:8088 $DEST/$DATE/metadata/ | |
DATABASES=`influx -execute "show databases" | sed -e 's/^name.*//;s/----//'` | |
for DB in $DATABASES; do | |
influxd backup -host $HOST:8088 -database $DB $DEST/$DATE/datadir/$DB | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment