crontab
This commit is contained in:
parent
27d29025fe
commit
13a376d128
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue