Skip to content

Instantly share code, notes, and snippets.

@cyhook
Forked from sithu/grafana-backup.sh
Created June 13, 2018 09:54
Show Gist options
  • Save cyhook/2e15cf30518a788c19b65c93acb9c09c to your computer and use it in GitHub Desktop.
Save cyhook/2e15cf30518a788c19b65c93acb9c09c to your computer and use it in GitHub Desktop.

Revisions

  1. @piotr1212 piotr1212 created this gist Nov 16, 2015.
    11 changes: 11 additions & 0 deletions grafana-backup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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}