diff --git a/VERSION b/VERSION index 5141b61..3ec370e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.4 \ No newline at end of file +3.4.5 \ No newline at end of file diff --git a/gravity-sync.sh b/gravity-sync.sh index a0880b0..879b04a 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.4' +VERSION='3.4.5' # 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 diff --git a/includes/gs-automate.sh b/includes/gs-automate.sh index 435d3a2..1c273cb 100644 --- a/includes/gs-automate.sh +++ b/includes/gs-automate.sh @@ -39,9 +39,16 @@ function task_automate { clear_cron fi + if [[ ${PATH} != *"/usr/sbin"* ]] + then + CRON_ENV_PATH=$'PATH=/bin:/usr/bin:/usr/sbin\n' + else + CRON_ENV_PATH="" + fi + MESSAGE="${UI_AUTO_CRON_SAVING}" echo_stat - (crontab -l 2>/dev/null; echo "*/${INPUT_AUTO_FREQ} * * * * ${BASH_PATH} ${LOCAL_FOLDR}/${GS_FILENAME} smart > ${LOG_PATH}/${CRONJOB_LOG}") | crontab - + (crontab -l 2>/dev/null; echo "${CRON_ENV_PATH}*/${INPUT_AUTO_FREQ} * * * * ${BASH_PATH} ${LOCAL_FOLDR}/${GS_FILENAME} smart > ${LOG_PATH}/${CRONJOB_LOG}") | crontab - error_validate elif [ $INPUT_AUTO_FREQ == 0 ] then @@ -84,4 +91,4 @@ function task_cron { echo_good show_crontab -} \ No newline at end of file +} diff --git a/includes/gs-backup.sh b/includes/gs-backup.sh index 8ff4d42..e1b6145 100644 --- a/includes/gs-backup.sh +++ b/includes/gs-backup.sh @@ -149,7 +149,7 @@ function backup_cleanup() { MESSAGE="${UI_BACKUP_PURGE}" echo_stat - find ${LOCAL_FOLDR}/${BACKUP_FOLD}/*.backup -mtime +${BACKUP_RETAIN} -type f -delete + 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.*$//')