From 248536417b0379feae6b17ffb85b1c53bb726f49 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Fri, 10 Jul 2020 21:43:05 -0500 Subject: [PATCH] backup --- ADVANCED.md | 4 ++-- CHANGELOG.md | 5 +++++ VERSION | 2 +- gravity-sync.sh | 15 ++++++++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ADVANCED.md b/ADVANCED.md index 2b019e4..4ce0455 100644 --- a/ADVANCED.md +++ b/ADVANCED.md @@ -14,8 +14,8 @@ Download the latest release from [GitHub](https://github.com/vmstan/gravity-sync ```bash cd ~ -wget https://github.com/vmstan/gravity-sync/archive/v2.0.2.zip -unzip v2.0.2.zip -d gravity-sync +wget https://github.com/vmstan/gravity-sync/archive/v2.1.0.zip +unzip v2.1.0.zip -d gravity-sync cd gravity-sync ``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 400d621..f5e3efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # The Changelog +## 2.1 +### The Backup Release + +A new function `./gravity-sync.sh backup` will now perform a sqlite operated backup of the `gravity.db` on the local Pi-hole. + ## 2.0 ### The Smart Release diff --git a/VERSION b/VERSION index f93ea0c..50aea0e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.2 \ No newline at end of file +2.1.0 \ No newline at end of file diff --git a/gravity-sync.sh b/gravity-sync.sh index 1611444..f7911d4 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -3,7 +3,7 @@ SCRIPT_START=$SECONDS # GRAVITY SYNC BY VMSTAN ##################### PROGRAM='Gravity Sync' -VERSION='2.0.2' +VERSION='2.1.0' # Execute from the home folder of the user who owns it (ex: 'cd ~/gravity-sync') # For documentation or downloading updates visit https://github.com/vmstan/gravity-sync @@ -1605,6 +1605,15 @@ function task_invalid { list_gs_arguments } +## Backup Task +function task_backup { + TASKTYPE='BACKUP' + MESSAGE="${MESSAGE}: ${TASKTYPE} Requested" + echo_good + + sqlite3 ${PIHOLE_DIR}/${GRAVITY_FI} ".backup '$HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/$(date +%F)-${GRAVITY_FI}'" +} + # Echo Stack ## Informative function echo_info { @@ -1800,6 +1809,10 @@ case $# in task_automate ;; + backup) + task_backup + ;; + *) task_invalid ;;