#!/bin/bash ######################################################################## # Author: Fred (support@qo-op.com) # Version: 2020.03.21 # License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/) ######################################################################## MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" echo ' ######################################################################## # \\/// # qo-op ############# '$MY_PATH/$ME' ######################################################################## # ex: ./'$ME' # VERIFY CRON for cron_MINUTE.sh and ACTIVATE it ########################################################################' # Get crontab crontab -l > /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 exit 0