This commit is contained in:
qo-op 2020-05-09 20:31:32 +02:00
parent 27d29025fe
commit 13a376d128
1 changed files with 6 additions and 3 deletions

View File

@ -22,9 +22,12 @@ crontab -l > /tmp/mycron
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron && echo "Astroport cron was there"
crontest=$(cat /tmp/mycron | grep -F 'cron_MINUTE')
# Create cron_MINUTE.sh cron
[[ ! $crontest ]] && echo "* * * * * $MY_PATH/../cron_MINUTE.sh >> /tmp/astroport.log 2>&1" >> /tmp/mycron && crontab /tmp/mycron \
|| echo "Cannot operate, please check crontab -l" && exit 1
if [[ ! $crontest ]]; then
echo "* * * * * $MY_PATH/../cron_MINUTE.sh >> /tmp/astroport.log 2>&1" >> /tmp/mycron && crontab /tmp/mycron \
else
echo "Cannot operate, please check crontab -l" && exit 1
fi
# Clean
rm /tmp/mycron
rm -f /tmp/mycron
exit 0