You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,36 @@ But for the sake of example, to finish the restore for the above Grafana setup,
90
90
1. Depending on the Grafana version, [you may need to set some permissions manually](http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later), e.g. `sudo chown -R 472:472 /var/lib/docker/volumes/bla-bla/_data`.
91
91
1. Start Grafana back up, with `docker-compose start dashboard`. Your Grafana instance should now have travelled back in time to its latest backup.
92
92
93
+
### Backing up to remote host by means of SCP
94
+
95
+
You can also upload to your backups to a remote host by means of secure copy (SCP) based on SSH. To do so, [create an SSH key pair if you do not have one yet and copy the public key to the remote host where your backups should be stored.](https://foofunc.com/how-to-create-and-add-ssh-key-in-remote-ssh-server/) Then, start the backup container by setting the variables `SCP_HOST`, `SCP_USER`, `SCP_DIRECTORY`, and provide the private SSH key by mounting it into `/ssh/id_rsa`.
96
+
97
+
In the example, we store the backups in the remote host folder `/home/pi/backups` and use the default SSH key located at `~/.ssh/id_rsa`:
98
+
99
+
```yml
100
+
version: "3"
101
+
102
+
services:
103
+
104
+
dashboard:
105
+
image: grafana/grafana:7.4.5
106
+
volumes:
107
+
- grafana-data:/var/lib/grafana # This is where Grafana keeps its data
- grafana-data:/backup/grafana-data:ro # Mount the Grafana data volume (as read-only)
117
+
- ~/.ssh/id_rsa:/ssh/id_rsa:ro # Mount the SSH private key (as read-only)
118
+
119
+
volumes:
120
+
grafana-data:
121
+
```
122
+
93
123
### Triggering a backup manually
94
124
95
125
Sometimes it's useful to trigger a backup manually, e.g. right before making some big changes.
@@ -209,6 +239,9 @@ Variable | Default | Notes
209
239
`AWS_SECRET_ACCESS_KEY`| | Required when using `AWS_S3_BUCKET_NAME`.
210
240
`AWS_DEFAULT_REGION`| | Optional when using `AWS_S3_BUCKET_NAME`. Allows you to override the AWS CLI default region. Usually not needed.
211
241
`AWS_EXTRA_ARGS`| | Optional additional args for the AWS CLI. Useful for e.g. providing `--endpoint-url <url>` for S3-interopable systems, such as DigitalOcean Storage.
242
+
`SCP_HOST`| | When provided, the resulting backup file will be uploaded by means of `scp` to the host stated.
243
+
`SCP_USER`| | User name to log into `SCP_HOST`.
244
+
`SCP_DIRECTORY`| | Directory on `SCP_HOST` where backup file is stored.
212
245
`GPG_PASSPHRASE`| | When provided, the backup will be encrypted with gpg using this `passphrase`.
213
246
`INFLUXDB_URL`| | When provided, backup metrics will be sent to an InfluxDB instance at this URL, e.g. `https://influxdb.example.com`.
214
247
`INFLUXDB_DB`| | Required when using `INFLUXDB_URL`; e.g. `my_database`.
0 commit comments