diff --git a/.gitignore b/.gitignore index 8210f50..906afbd 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/VERSION b/VERSION index 7921bd0..e5b8203 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.8 +3.5.0 \ No newline at end of file diff --git a/gravity-sync.sh b/gravity-sync.sh index fa301cb..ae65d1a 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -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 @@ -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 @@ -133,9 +132,6 @@ case $# in push) start_gs task_push ;; - restore) - start_gs - task_restore ;; version) start_gs_noconfig task_version ;; @@ -160,9 +156,6 @@ case $# in auto|automate) start_gs task_automate ;; - backup) - start_gs - task_backup ;; purge) start_gs task_purge ;; diff --git a/includes/gs-backup.sh b/includes/gs-backup.sh index 1c5eddc..76167ff 100644 --- a/includes/gs-backup.sh +++ b/includes/gs-backup.sh @@ -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 } \ No newline at end of file diff --git a/includes/gs-config.sh b/includes/gs-config.sh index 98f786c..07131e5 100644 --- a/includes/gs-config.sh +++ b/includes/gs-config.sh @@ -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 @@ -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 @@ -487,4 +474,4 @@ function create_alias { echo -e "alias gravity-sync='${GS_FILEPATH}'" | sudo tee -a /etc/bash.bashrc > /dev/null error_validate -} +} \ No newline at end of file diff --git a/includes/gs-exit.sh b/includes/gs-exit.sh index a6b588f..453aee2 100644 --- a/includes/gs-exit.sh +++ b/includes/gs-exit.sh @@ -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" diff --git a/includes/gs-ui.sh b/includes/gs-ui.sh index e424fb6..1f54f61 100644 --- a/includes/gs-ui.sh +++ b/includes/gs-ui.sh @@ -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!" diff --git a/includes/gs-update.sh b/includes/gs-update.sh index 048a402..71f92d2 100644 --- a/includes/gs-update.sh +++ b/includes/gs-update.sh @@ -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 } diff --git a/templates/gravity-sync.conf.example b/templates/gravity-sync.conf.example index 0c01050..f8b60bc 100644 --- a/templates/gravity-sync.conf.example +++ b/templates/gravity-sync.conf.example @@ -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