mirror of
https://github.com/YunoHost-Apps/grafana_ynh.git
synced 2024-09-03 20:36:29 +02:00
Fix backup/restore
This commit is contained in:
parent
5a2de2c4d1
commit
a6403c4481
2 changed files with 3 additions and 3 deletions
|
@ -34,9 +34,8 @@ ynh_backup "/var/lib/grafana/plugins" "conf_grafana_plugins"
|
||||||
|
|
||||||
# Backup InfluxDB data
|
# Backup InfluxDB data
|
||||||
# Source: http://stackoverflow.com/questions/39501416/how-to-restore-data-base-using-influxd
|
# Source: http://stackoverflow.com/questions/39501416/how-to-restore-data-base-using-influxd
|
||||||
TMPDIR=$(mktemp -d)
|
mkdir influxdb_data
|
||||||
influxd backup -database opentsdb $TMPDIR
|
influxd backup -database opentsdb influxdb_data
|
||||||
ynh_backup "$TMPDIR" "influxdb_data"
|
|
||||||
|
|
||||||
# Dump the Grafana database
|
# Dump the Grafana database
|
||||||
dbname=$app
|
dbname=$app
|
||||||
|
|
|
@ -58,6 +58,7 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ./dump.sql
|
||||||
|
|
||||||
# Restore InfluxDB data (only if backup not empty)
|
# Restore InfluxDB data (only if backup not empty)
|
||||||
# That happens when passing automated tests (NetData not present)
|
# That happens when passing automated tests (NetData not present)
|
||||||
|
sudo systemctl stop influxdb
|
||||||
if [ "$(ls -A $SRCPATH/influxdb_data)" ] ; then
|
if [ "$(ls -A $SRCPATH/influxdb_data)" ] ; then
|
||||||
sudo influxd restore -metadir /var/lib/influxdb/meta $SRCPATH/influxdb_data
|
sudo influxd restore -metadir /var/lib/influxdb/meta $SRCPATH/influxdb_data
|
||||||
if [ "$(ls -A $SRCPATH/influxdb_data/opentsdb*)" ] ; then
|
if [ "$(ls -A $SRCPATH/influxdb_data/opentsdb*)" ] ; then
|
||||||
|
|
Loading…
Reference in a new issue