1
0
mirror of https://github.com/namibia/demo-sync.git synced 2024-11-21 19:15:10 +00:00

Added better formatting to cron message.

This commit is contained in:
Llewellyn van der Merwe 2020-03-06 17:22:48 +02:00
parent efa5b42f05
commit 7fe7fef244
No known key found for this signature in database
GPG Key ID: 8A8F406BA7238C4E

View File

@ -140,16 +140,17 @@ function setCron () {
echo "" >> "${CRONPATH}" echo "" >> "${CRONPATH}"
fi fi
# get the Source Database IP/Domain # get the Source Database IP/Domain
echo -ne "\n Add the cron timer here so you sync will run every day at 4am.\n" echo -e "\n ################################################################################################"
echo -ne " # That will look like our example below, see https://crontab.guru/#0_4_*_*_* for more details.\n" echo -ne " ## Add the CRON TIMER here so you sync will run every day at 4am.\n"
read -e -p " # Example (0 4 * * *): " -i "0 4 * * *" INPUT_CRON_CICLE echo -ne " ## That will look like our example below, see https://crontab.guru/#0_4_*_*_* for more details.\n"
echo -e " ################################################################################################"
read -e -p " ## Example (0 4 * * *): " -i "0 4 * * *" INPUT_CRON_CICLE
# check if the @reboot curl -s $SCRIPTURL | sudo bash is already set # check if the @reboot curl -s $SCRIPTURL | sudo bash is already set
if [[ $currentCron != *"${INPUT_CRON_CICLE} curl -s $SCRIPTURL | bash"* ]]; then if [[ $currentCron != *"${INPUT_CRON_CICLE} curl -s $SCRIPTURL | bash"* ]]; then
echo "${INPUT_CRON_CICLE} curl -s $SCRIPTURL | bash" >> "${CRONPATH}" echo "${INPUT_CRON_CICLE} curl -s $SCRIPTURL | bash" >> "${CRONPATH}"
fi fi
# set the user cron # set the user cron
crontab -u $ACTIVEUSER "${CRONPATH}" crontab -u $ACTIVEUSER "${CRONPATH}"
echo "Done"
fi fi
} }