Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

3.5.0 #296

Merged
merged 14 commits into from
Feb 25, 2022
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ gravity-sync.log
gravity-sync.cron
gravity-sync.conf
gravity-sync.md5
backup/*.last
backup/*.backup
backup/*.push
backup/*.pull
logs/*
settings/gravity-sync.conf
dev
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.8
3.5.0
9 changes: 1 addition & 8 deletions gravity-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SCRIPT_START=$SECONDS

# GRAVITY SYNC BY VMSTAN #####################
PROGRAM='Gravity Sync'
VERSION='3.4.8'
VERSION='3.5.0'

# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
# Requires Pi-Hole 5.x or higher already be installed, for help visit https://pi-hole.net
Expand Down Expand Up @@ -51,7 +51,6 @@ PING_AVOID='0' # replace in gravity-sync.conf to overwrite
ROOT_CHECK_AVOID='0' # replace in gravity-sync.conf to overwrite

# Backup Customization
BACKUP_RETAIN='3' # replace in gravity-sync.conf to overwrite
BACKUP_TIMEOUT='240' # replace in gravity-sync.conf to overwrite
BACKUP_INTEGRITY_WAIT='5' # replace in gravity-sync.conf to overwrite

Expand Down Expand Up @@ -133,9 +132,6 @@ case $# in
push)
start_gs
task_push ;;
restore)
start_gs
task_restore ;;
version)
start_gs_noconfig
task_version ;;
Expand All @@ -160,9 +156,6 @@ case $# in
auto|automate)
start_gs
task_automate ;;
backup)
start_gs
task_backup ;;
purge)
start_gs
task_purge ;;
Expand Down
24 changes: 2 additions & 22 deletions includes/gs-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,6 @@ function backup_cleanup() {
MESSAGE="${UI_BACKUP_PURGE}"
echo_stat

rm -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/*.pull
rm -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/*.push

if [ "${TASKTYPE}" != "BACKUP" ]
then
if [ "${BACKUP_RETAIN}" == '0' ]
then
rm -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/*.backup
error_validate

MESSAGE="${UI_BACKUP_DELETE_ALL}"
echo_info
else
find ${LOCAL_FOLDR}/${BACKUP_FOLD}/ -name "*.backup*" -mtime +${BACKUP_RETAIN} -type f -delete
error_validate

BACKUP_FOLDER_SIZE=$(du -h ${LOCAL_FOLDR}/${BACKUP_FOLD} | sed 's/\s.*$//')

MESSAGE="${BACKUP_RETAIN} ${UI_BACKUP_REMAIN} (${BACKUP_FOLDER_SIZE})"
echo_info
fi
fi
git clean -fq
error_validate
}
17 changes: 2 additions & 15 deletions includes/gs-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function config_generate {
MESSAGE="Required Gravity Sync Settings"
echo_info

MESSAGE="Primary/Remote Pi-hole Address (IP or DNS)"
MESSAGE="Primary/Remote Pi-hole Host Address (IP or DNS)"
echo_need
read INPUT_REMOTE_HOST

Expand Down Expand Up @@ -417,19 +417,6 @@ function advanced_config_generate {
error_validate
fi
fi

MESSAGE="Change Backup Retention in Days? (Leave blank for default '3')"
echo_need
read INPUT_BACKUP_RETAIN
INPUT_BACKUP_RETAIN="${INPUT_BACKUP_RETAIN:-3}"

if [ "${INPUT_BACKUP_RETAIN}" != "3" ]
then
MESSAGE="Saving Backup Retention to ${CONFIG_FILE}"
echo_stat
sed -i "/# BACKUP_RETAIN=''/c\BACKUP_RETAIN='${INPUT_BACKUP_RETAIN}'" ${LOCAL_FOLDR}/settings/${CONFIG_FILE}
error_validate
fi
}

## Delete Existing Configuration
Expand Down Expand Up @@ -487,4 +474,4 @@ function create_alias {

echo -e "alias gravity-sync='${GS_FILEPATH}'" | sudo tee -a /etc/bash.bashrc > /dev/null
error_validate
}
}
2 changes: 0 additions & 2 deletions includes/gs-exit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ function list_gs_arguments {
echo -e " ${YELLOW}pull${NC} Brings the remote Pi-hole configuration to this server"
echo -e " ${YELLOW}push${NC} Sends the local Pi-hole configuration to the primary"
echo -e " ${YELLOW}compare${NC} Just checks for Pi-hole differences at each side without making changes"
echo -e " ${YELLOW}restore${NC} Restores the Pi-hole configuration on this server"
echo -e " ${YELLOW}backup${NC} Just backs up the Pi-hole on this server"
echo_blank
echo -e "Debug Options:"
echo -e " ${YELLOW}logs${NC} Shows the recent successful replication jobs/times"
Expand Down
14 changes: 7 additions & 7 deletions includes/gs-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ UI_LOGGING_MISSING='is missing'
UI_LOGGING_RECENT_COMPLETE='Recent complete executions of'

# Backup
UI_BACKUP_PRIMARY='Performing backup of primary'
UI_BACKUP_COPY='Pulling backup of primary'
UI_BACKUP_SECONDARY='Performing backup of secondary'
UI_BACKUP_PURGE='Purging redundant backups on secondary Pi-hole instance'
UI_BACKUP_PRIMARY='Performing copy of primary'
UI_BACKUP_COPY='Pulling copy of primary'
UI_BACKUP_SECONDARY='Performing copy of secondary'
UI_BACKUP_PURGE='Purging unused data files from this Pi-hole instance'
UI_BACKUP_REMAIN='days of backups remain'
UI_BACKUP_INTEGRITY="Checking ${UI_GRAVITY_NAME} backup integrity"
UI_BACKUP_INTEGRITY="Checking ${UI_GRAVITY_NAME} copy integrity"
UI_BACKUP_INTEGRITY_FAILED='Integrity check has failed for the primary'
UI_BACKUP_INTEGRITY_DELETE='Removing failed backup'
UI_BACKUP_DELETE_ALL='All backup files purged'
UI_BACKUP_INTEGRITY_DELETE='Removing failed copies'
UI_BACKUP_DELETE_ALL='All unused data files purged'

# Restore
UI_RESTORE_WARNING="This will overwrite your current Pi-hole settings on $HOSTNAME with a previous version!"
Expand Down
4 changes: 4 additions & 0 deletions includes/gs-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ function update_gs {
echo_stat
git reset --hard ${BRANCH} >/dev/null 2>&1
error_validate
MESSAGE="Cleaning things up"
echo_stat
git clean -fq
error_validate
fi
}

Expand Down
1 change: 0 additions & 1 deletion templates/gravity-sync.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ REMOTE_USER='pi'
# ROOT_CHECK_AVOID='' # replace in gravity-sync.conf to overwrite

### Backup Customization
# BACKUP_RETAIN='' # replace in gravity-sync.conf to overwrite
# BACKUP_TIMEOUT='' # replace in gravity-sync.conf to overwrite
# BACKUP_INTEGRITY_WAIT='' # time to wait after backup for integrity check

Expand Down