mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
3.5.0 (#296)
* Fixed typo (#269) * Fix cache wipe (#282) * Update gs-pull.sh `restartdns Full restart Pi-hole subsystems Add 'reload' to update the lists and flush the cache without restarting the DNS server Add 'reload-lists' to only update the lists WITHOUT flushing the cache or restarting the DNS server` fixing typo * Update gs-push.sh fixing typo * Update VERSION * Update gravity-sync.sh * new version * Clear backup directory * Cleanup after updating * remove backup functions * Remove reference to backup and restore functions * Change backup references to copy * Host * Remove reference to backup retention * Remove reference to backup retention Co-authored-by: Philippe Ouellette <philippeouellette@protonmail.com> Co-authored-by: djschnei21 <32646250+djschnei21@users.noreply.github.com>
This commit is contained in:
parent
93656c29ea
commit
3a125a2e30
4
.gitignore
vendored
4
.gitignore
vendored
@ -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
|
||||
|
@ -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 ;;
|
||||
|
@ -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
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
@ -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"
|
||||
|
@ -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!"
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user