Change cron_MINUTE.sh cron PATH

This commit is contained in:
qo-op 2020-05-07 17:02:44 +02:00
parent 3a57378c00
commit d15991f18b
2 changed files with 10 additions and 7 deletions

View File

@ -8,6 +8,9 @@ MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# Change cron_MINUTE.sh cron PATH
$PATH/cron_VRFY.sh
[[ ! $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]] && echo "ipfs daemon not running. EXIT" && exit 1
ipfsnodeid=$(/usr/local/bin/ipfs id -f='<id>\n')

View File

@ -16,15 +16,15 @@ echo '
# ex: ./'$ME'
# VERIFY CRON for cron_MINUTE.sh and ACTIVATE it
########################################################################'
[[ $(crontab -l 2>&1 | grep "cron_MINUTE") ]] && exit 0
# Get crontab
crontab -l > /tmp/mycron
echo "* * * * * $MY_PATH/cron_MINUTE.sh >> /tmp/astroport.log 2>&1" >> /tmp/mycron
# Remove any previous line containing "cron_MINUTE"
awk -i inplace -v rmv="cron_MINUTE" '!index($0,rmv)' /tmp/mycron && echo "Astroport cron was there"
# Create cron_MINUTE.sh cron
echo "* * * * * $MY_PATH/../cron_MINUTE.sh >> /tmp/astroport.log 2>&1" >> /tmp/mycron
# Write crontab
crontab /tmp/mycron
# Clean
rm /tmp/mycron
# MAKE IPFS SWARM refresh
$MY_PATH/ipfs_SWARM_refresh.sh
exit 0