This commit is contained in:
qo-op 2020-05-09 20:26:43 +02:00
parent c49c16d040
commit 27d29025fe
1 changed files with 1 additions and 2 deletions

View File

@ -22,8 +22,7 @@ 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 # Write crontab
[[ ! $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
# Clean
rm /tmp/mycron