mirror of
https://github.com/vmstan/gravity-sync.git
synced 2025-05-24 00:02:22 -04: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 #####################
|
# GRAVITY SYNC BY VMSTAN #####################
|
||||||
PROGRAM='Gravity Sync'
|
PROGRAM='Gravity Sync'
|
||||||
VERSION='3.4.4'
|
VERSION='3.4.5'
|
||||||
|
|
||||||
# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
|
# 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
|
# 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
|
clear_cron
|
||||||
fi
|
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}"
|
MESSAGE="${UI_AUTO_CRON_SAVING}"
|
||||||
echo_stat
|
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
|
error_validate
|
||||||
elif [ $INPUT_AUTO_FREQ == 0 ]
|
elif [ $INPUT_AUTO_FREQ == 0 ]
|
||||||
then
|
then
|
||||||
@ -84,4 +91,4 @@ function task_cron {
|
|||||||
echo_good
|
echo_good
|
||||||
|
|
||||||
show_crontab
|
show_crontab
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ function backup_cleanup() {
|
|||||||
MESSAGE="${UI_BACKUP_PURGE}"
|
MESSAGE="${UI_BACKUP_PURGE}"
|
||||||
echo_stat
|
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
|
error_validate
|
||||||
|
|
||||||
BACKUP_FOLDER_SIZE=$(du -h ${LOCAL_FOLDR}/${BACKUP_FOLD} | sed 's/\s.*$//')
|
BACKUP_FOLDER_SIZE=$(du -h ${LOCAL_FOLDR}/${BACKUP_FOLD} | sed 's/\s.*$//')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user