* Add the addition of an Environment Path variable in Crontab (#212)

* Add detection of missing path components and addition of path to crontab

* Fix bug where \n is inserted literally

* Fix `find` command invoke (Issue #220) (#223)

* 3.4.5

Co-authored-by: Michael Thompson <25192401+nh-mike@users.noreply.github.com>
Co-authored-by: benjaminfd <psyko_chewbacca@hotmail.com>
Co-authored-by: Michael Stanclift <vmstan@ms-macbook.local>
This commit is contained in:
Michael Stanclift 2021-07-18 22:09:55 -05:00 committed by GitHub
parent b19eaf8e22
commit 295b237da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View File

@ -1 +1 @@
3.4.4
3.4.5

View File

@ -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

View File

@ -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
}
}

View File

@ -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.*$//')