From 78f97716a857eb9cd170860d58c798e21ca3fcc5 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Sat, 11 Jul 2020 15:17:27 -0500 Subject: [PATCH] backup remote grav --- gravity-sync.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gravity-sync.sh b/gravity-sync.sh index 190d1fd..8f2585b 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -148,6 +148,8 @@ function pull_gs_grav { # echo_stat # cp ${PIHOLE_DIR}/${GRAVITY_FI} $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/${GRAVITY_FI}.backup >/dev/null 2>&1 # error_validate + + MESSAGE="Pulling ${GRAVITY_FI} from ${REMOTE_HOST}" echo_stat @@ -205,6 +207,7 @@ function pull_gs_grav { ## Pull Custom function pull_gs_cust { + backup_local_custom if [ "$SKIP_CUSTOM" != '1' ] @@ -307,6 +310,8 @@ function pull_gs { ## Push Gravity function push_gs_grav { + backup_remote_gravity + MESSAGE="Backing Up ${GRAVITY_FI} from ${REMOTE_HOST}" echo_stat RSYNC_REPATH="rsync" @@ -1734,6 +1739,16 @@ function backup_local_custom { fi } +function backup_remote_gravity { + CMD_TIMEOUT='15' + CMD_REQUESTED="sqlite3 ${PIHOLE_DIR}/${GRAVITY_FI} \".backup '${PIHOLE_DIR}/${GRAVITY_FI}.backup'\"" + create_sshcmd +} + +function backup_remote_custom { + +} + function backup_cleanup { MESSAGE="Cleaning Up Old Backups" echo_stat