Validate cron log existance

This commit is contained in:
Michael Stanclift 2020-05-24 17:30:33 -05:00
parent ff0c8c5fd5
commit 8965fadcc7

View File

@ -327,15 +327,25 @@ case $# in
;;
cron)
if [ -f $HOME/${LOCAL_FOLDR}/${CRONJOB_LOG} ]
CRONPATH="$HOME/${LOCAL_FOLDR}/${CRONJOB_LOG}"
MESSAGE="Replaying Last Cronjob"
echo -e "${STAT} ${MESSAGE}"
if [ -f ${CRONPATH} ]
then
MESSAGE="Replaying Last Cronjob"
echo -e "${GOOD} ${MESSAGE}"
if [ -s ${CRONPATH} ]
echo -e "${GOOD} ${MESSAGE}"
logs_crontab
then
echo -e "${FAIL} ${MESSAGE}"
echo -e "${YELLOW}${CRONPATH}${NC} appears empty"
exit_nochange
fi
else
MESSAGE="Replaying Last Cronjob"
echo -e "${FAIL} ${MESSAGE}"
exit_nochange
echo -e "${YELLOW}${CRONPATH}${NC} cannot be located"
exit_nochange
fi
exit_nochange
@ -351,7 +361,8 @@ case $# in
;;
*)
echo -e "${FAIL} Too Many Arguments"
MESSAGE="Too Many Arguments"
echo -e "${FAIL} ${MESSAGE}"
list_gs_arguments
exit_nochange
;;