diff --git a/files/bin/startup.sh b/files/bin/startup.sh index 37a317c..860c840 100644 --- a/files/bin/startup.sh +++ b/files/bin/startup.sh @@ -1,15 +1,17 @@ #!/bin/bash +CRONFILE=/opt/tier/tier-cron + #set env vars for cron job /opt/tier/setenv.sh #build crontab file with random start time between midnight and 3:59am -echo "#send daily beacon to TIER Central" > /opt/tier/tier-cron -echo "* * * * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> /opt/tier/tier-cron -echo "#"$(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> /opt/tier/tier-cron -chmod 644 /opt/tier/tier-cron +echo "#send daily beacon to TIER Central" > ${CRONFILE} +echo "* * * * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> ${CRONFILE} +echo "#"$(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1" >> ${CRONFILE} +chmod 644 ${CRONFILE} #install crontab -crontab /opt/tier/tier-crontab +crontab ${CRONFILE} #create cron logfile touch /var/log/cron.log