Skip to content

Instantly share code, notes, and snippets.

@sithu
Forked from piotr1212/grafana-backup.sh
Created July 15, 2017 06:31
Show Gist options
  • Save sithu/b2e41876fb17cfda1a3477638130d521 to your computer and use it in GitHub Desktop.
Save sithu/b2e41876fb17cfda1a3477638130d521 to your computer and use it in GitHub Desktop.
Grafana sqlite backup script
cat /usr/share/grafana/grafana-backup.sh
#!/bin/bash
DB="/var/lib/grafana/grafana.db"
BACKUP="/data/backup/grafana/grafana.db-$(date +%Y%m%d).bck"
SQLITE=/usr/bin/sqlite3
ZIP=/bin/gzip
${SQLITE} ${DB} ".backup ${BACKUP}"
${ZIP} ${BACKUP}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment