mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
3.4.5 (#224)
* 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:
parent
b19eaf8e22
commit
295b237da9
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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.*$//')
|
||||
|
Loading…
Reference in New Issue
Block a user